diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-11-02 15:39:52 +0300 |
---|---|---|
committer | max-nextcloud <max@nextcloud.com> | 2022-11-07 17:00:49 +0300 |
commit | 581233665bb7516c2da5cd3bd74f030c08ff10f2 (patch) | |
tree | ae4675c499f98dd5bbb5a53c110563da8da0b2bf | |
parent | b6d1ec49c8dc18e55dde4497dd5650d0547bea14 (diff) |
Do not render the workspace if file list is hidden
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r-- | src/helpers/files.js | 7 | ||||
-rw-r--r-- | src/views/RichWorkspace.vue | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/helpers/files.js b/src/helpers/files.js index 7b6036154..b95f06bcf 100644 --- a/src/helpers/files.js +++ b/src/helpers/files.js @@ -21,6 +21,7 @@ */ import { loadState } from '@nextcloud/initial-state' +import { subscribe } from '@nextcloud/event-bus' import { openMimetypes } from './mime.js' import { getSharingToken } from './token.js' import RichWorkspace from '../views/RichWorkspace.vue' @@ -174,6 +175,12 @@ const FilesWorkspacePlugin = { store, }).$mount(this.el) + subscribe('files:navigation:changed', () => { + // Expose if the default file list is active to the component + // to only render the workspace if the file list is actually visible + vm.active = OCA.Files.App.getCurrentFileList() === fileList + }) + fileList.$el.on('urlChanged', data => { vm.path = data.dir.toString() }) diff --git a/src/views/RichWorkspace.vue b/src/views/RichWorkspace.vue index 06916d1bf..c0a86d1e9 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, 'dark': darkTheme, 'creatable': canCreate, 'empty': showEmptyWorkspace}"> + <div v-if="enabled && active" id="rich-workspace" :class="{'icon-loading': !loaded || !ready, 'focus': focus, 'dark': darkTheme, 'creatable': canCreate, 'empty': showEmptyWorkspace}"> <a v-if="showEmptyWorkspace" tabindex="0" class="empty-workspace" @@ -71,6 +71,10 @@ export default { type: String, required: true, }, + active: { + type: Boolean, + default: true, + }, }, data() { return { |