diff options
author | Simon L <szaimen@e.mail.de> | 2023-01-04 00:09:16 +0100 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2023-01-04 09:17:30 +0000 |
commit | 088e9b0feb540703f46b5fb13f7939d0ce0f129a (patch) | |
tree | c5501634e71013396ba3af4fbc78857b3c877fa1 /apps | |
parent | b37a4950e4b2c8cf79b59295a07d40e34afea423 (diff) | |
download | nextcloud-server-088e9b0feb540703f46b5fb13f7939d0ce0f129a.tar.gz nextcloud-server-088e9b0feb540703f46b5fb13f7939d0ce0f129a.zip |
appsidebar should be compact when opened on small heights
Signed-off-by: Simon L <szaimen@e.mail.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/views/Sidebar.vue | 13 |
1 files changed, 12 insertions, 1 deletions
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) }, } </script> |