diff options
-rw-r--r-- | src/views/RichWorkspace.vue | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/views/RichWorkspace.vue b/src/views/RichWorkspace.vue index 96f10b043..b344dfd7a 100644 --- a/src/views/RichWorkspace.vue +++ b/src/views/RichWorkspace.vue @@ -21,7 +21,7 @@ --> <template> - <div v-if="enabled" id="rich-workspace" :class="{'icon-loading': !loaded || !ready, 'focus': focus }"> + <div v-if="enabled" id="rich-workspace" :class="{'icon-loading': !loaded || !ready, 'focus': focus, 'dark': darkTheme }"> <div v-if="!file || (autofocus && !ready)" class="empty-workspace" @click="createNew"> <p class="placeholder"> {{ t('text', 'Add notes, lists or links …') }} @@ -71,6 +71,7 @@ export default { loaded: false, ready: false, autofocus: false, + darkTheme: OCA.Accessibility.theme === 'dark', enabled: OCA.Text.RichWorkspaceEnabled, } }, @@ -83,6 +84,11 @@ export default { path: function() { this.getFileInfo() }, + focus: function(newValue) { + if (!newValue) { + document.querySelector('#editor').scrollTo(0, 0) + } + }, }, async mounted() { if (this.enabled) { @@ -213,11 +219,15 @@ export default { bottom: 0; left: 0; pointer-events: none; - background-image: linear-gradient(to bottom, rgba(0,0,0, 0), var(--color-main-background)); + background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background)); width: 100%; height: 4em; } + #rich-workspace.dark:not(.focus):not(.icon-loading):after { + background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--color-main-background)); + } + @media only screen and (max-width: 1024px) { #rich-workspace:not(.focus) { max-height: 30vh; |