From c03a14934b543c6734e5458f814997e419cf808b Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Wed, 26 May 2021 18:21:30 +0200 Subject: Trigger click event when scrollTo is set Signed-off-by: Louis Chemineau --- apps/files/src/sidebar.js | 1 + apps/files/src/views/Sidebar.vue | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'apps/files/src') diff --git a/apps/files/src/sidebar.js b/apps/files/src/sidebar.js index 274b2f49fd9..bc483f833e8 100644 --- a/apps/files/src/sidebar.js +++ b/apps/files/src/sidebar.js @@ -58,4 +58,5 @@ window.addEventListener('DOMContentLoaded', function() { AppSidebar.$mount('#app-sidebar') window.OCA.Files.Sidebar.open = AppSidebar.open window.OCA.Files.Sidebar.close = AppSidebar.close + window.OCA.Files.Sidebar.setFullScreenMode = AppSidebar.setFullScreenMode }) diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue index da25a3e6ce1..fa53f2af0a9 100644 --- a/apps/files/src/views/Sidebar.vue +++ b/apps/files/src/views/Sidebar.vue @@ -110,6 +110,7 @@ export default { loading: true, fileInfo: null, starLoading: false, + isFullScreen: false, } }, @@ -202,7 +203,10 @@ export default { 'star-loading': this.starLoading, active: this.activeTab, background: this.background, - class: { 'has-preview': this.fileInfo.hasPreview }, + class: { + 'app-sidebar--has-preview': this.fileInfo.hasPreview, + 'app-sidebar--full': this.isFullScreen, + }, compact: !this.fileInfo.hasPreview, loading: this.loading, starred: this.fileInfo.isFavourited, @@ -428,6 +432,14 @@ export default { this.resetData() }, + /** + * Allow to set the Sidebar as fullscreen from OCA.Files.Sidebar + * @param {boolean} isFullScreen - Wether or not to render the Sidebar in fullscreen. + */ + setFullScreenMode(isFullScreen) { + this.isFullScreen = isFullScreen + }, + /** * Emit SideBar events. */ @@ -448,7 +460,7 @@ export default { -- cgit v1.2.3