From 088e9b0feb540703f46b5fb13f7939d0ce0f129a Mon Sep 17 00:00:00 2001 From: Simon L Date: Wed, 4 Jan 2023 00:09:16 +0100 Subject: appsidebar should be compact when opened on small heights Signed-off-by: Simon L Signed-off-by: nextcloud-command --- apps/files/src/views/Sidebar.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue index 4c29da59708..1fb60f7fc39 100644 --- a/apps/files/src/views/Sidebar.vue +++ b/apps/files/src/views/Sidebar.vue @@ -117,6 +117,7 @@ export default { fileInfo: null, starLoading: false, isFullScreen: false, + hasLowHeight: false, } }, @@ -231,7 +232,7 @@ export default { 'app-sidebar--has-preview': this.fileInfo.hasPreview && !this.isFullScreen, 'app-sidebar--full': this.isFullScreen, }, - compact: !this.fileInfo.hasPreview || this.isFullScreen, + compact: this.hasLowHeight || !this.fileInfo.hasPreview || this.isFullScreen, loading: this.loading, starred: this.fileInfo.isFavourited, subtitle: this.subtitle, @@ -489,6 +490,16 @@ export default { handleClosed() { emit('files:sidebar:closed') }, + handleWindowResize() { + this.hasLowHeight = document.documentElement.clientHeight < 1024 + }, + }, + created() { + window.addEventListener('resize', this.handleWindowResize) + this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) }, } -- cgit v1.2.3