summaryrefslogtreecommitdiffstats
path: root/apps/files/src/views/Sidebar.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src/views/Sidebar.vue')
-rw-r--r--apps/files/src/views/Sidebar.vue13
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>