From a15bf7ead6ea8d87839ea406b526e9611d6d820d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Fri, 1 Mar 2019 17:54:05 +0100 Subject: [PATCH] Close viewer on sidebar opening MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- src/views/Viewer.vue | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index 6d9ce06ca..45b2822ac 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -113,7 +113,6 @@ export default { failed: false, loading: true, - openedSidebar: false, root: `/remote.php/dav/files/${OC.getCurrentUser().uid}` }), @@ -133,13 +132,15 @@ export default { return '' }, actions() { - return [ - { - text: t('viewer', 'Share'), - icon: 'icon-share-white-forced', - action: this.showSharingSidebar - } - ] + return OCA.Sharing + ? [ + { + text: t('viewer', 'Share'), + icon: 'icon-share-white-forced', + action: this.showSharingSidebar + } + ] + : [] } }, @@ -213,11 +214,6 @@ export default { modal, failed: false } - - // if the sidebar is already opened, change the current file - if (this.openedSidebar) { - OCA.Files.App.fileList.showDetailsView(this.currentFileName, 'shareTabView') - } } this.updatePreviousNext() @@ -419,17 +415,7 @@ export default { showSharingSidebar() { // Open the sidebar sharing tab OCA.Files.App.fileList.showDetailsView(this.currentFileName, 'shareTabView') - - const sidebar = document.getElementById('app-sidebar') - const closeButton = sidebar.querySelector('.icon-close') - - // Sidebar above the modal - sidebar.style.zIndex = 10001 - this.openedSidebar = true - closeButton.addEventListener('click', e => { - sidebar.style.zIndex = null - this.openedSidebar = false - }) + this.close() } } }