From 4438f21b60b85502885fd7ad6d4b39aa9a0f26b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 28 Oct 2019 12:22:03 +0100 Subject: [PATCH] Autohide only for rich workspaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- css/prosemirror.scss | 60 --------------------------- src/components/EditorWrapper.vue | 71 ++++++++++++++++++++++++++++++-- src/components/MenuBar.vue | 10 +++-- src/files.js | 8 +++- src/views/RichWorkspace.vue | 1 + 5 files changed, 83 insertions(+), 67 deletions(-) diff --git a/css/prosemirror.scss b/css/prosemirror.scss index 3c17e4ee4..8b2dd9def 100644 --- a/css/prosemirror.scss +++ b/css/prosemirror.scss @@ -145,66 +145,6 @@ div.ProseMirror { .ProseMirror-focused .ProseMirror-gapcursor { display: block; } -&:not(.richEditor) .ProseMirror { - pre { - background-color: var(--color-main-background); - - &::before { - content: attr(data-language); - text-transform: uppercase; - display: block; - text-align: right; - font-weight: bold; - font-size: 0.6rem; - } - code { - .hljs-comment, - .hljs-quote { - color: #999999; - } - .hljs-variable, - .hljs-template-variable, - .hljs-attribute, - .hljs-tag, - .hljs-name, - .hljs-regexp, - .hljs-link, - .hljs-name, - .hljs-selector-id, - .hljs-selector-class { - color: #f2777a; - } - .hljs-number, - .hljs-meta, - .hljs-built_in, - .hljs-builtin-name, - .hljs-literal, - .hljs-type, - .hljs-params { - color: #f99157; - } - .hljs-string, - .hljs-symbol, - .hljs-bullet { - color: #99cc99; - } - .hljs-title, - .hljs-section { - color: #ffcc66; - } - .hljs-keyword, - .hljs-selector-tag { - color: #6699cc; - } - .hljs-emphasis { - font-style: italic; - } - .hljs-strong { - font-weight: 700; - } - } - } -} .editor__content p.is-empty:first-child::before { content: attr(data-empty-text); diff --git a/src/components/EditorWrapper.vue b/src/components/EditorWrapper.vue index e3395fb14..f1ab885ff 100644 --- a/src/components/EditorWrapper.vue +++ b/src/components/EditorWrapper.vue @@ -35,7 +35,8 @@ + :is-rich-editor="isRichEditor" + :autohide="autohide">
{{ lastSavedStatus }} @@ -119,8 +120,12 @@ export default { }, mime: { type: String, - default: null - } + default: null, + }, + autohide: { + type: Boolean, + default: false, + }, }, data() { return { @@ -569,5 +574,65 @@ export default { #editor-wrapper { @import './../../css/prosemirror'; + + &:not(.richEditor) .ProseMirror { + pre { + background-color: var(--color-main-background); + + &::before { + content: attr(data-language); + text-transform: uppercase; + display: block; + text-align: right; + font-weight: bold; + font-size: 0.6rem; + } + code { + .hljs-comment, + .hljs-quote { + color: #999999; + } + .hljs-variable, + .hljs-template-variable, + .hljs-attribute, + .hljs-tag, + .hljs-name, + .hljs-regexp, + .hljs-link, + .hljs-selector-id, + .hljs-selector-class { + color: #f2777a; + } + .hljs-number, + .hljs-meta, + .hljs-built_in, + .hljs-builtin-name, + .hljs-literal, + .hljs-type, + .hljs-params { + color: #f99157; + } + .hljs-string, + .hljs-symbol, + .hljs-bullet { + color: #99cc99; + } + .hljs-title, + .hljs-section { + color: #ffcc66; + } + .hljs-keyword, + .hljs-selector-tag { + color: #6699cc; + } + .hljs-emphasis { + font-style: italic; + } + .hljs-strong { + font-weight: 700; + } + } + } + } } diff --git a/src/components/MenuBar.vue b/src/components/MenuBar.vue index d8df94393..b848988e0 100644 --- a/src/components/MenuBar.vue +++ b/src/components/MenuBar.vue @@ -22,7 +22,7 @@