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>
This commit is contained in:
Simon L 2023-01-04 00:09:16 +01:00 committed by nextcloud-command
parent 0a5b3d03df
commit d072a5201d
3 changed files with 15 additions and 4 deletions

View file

@ -112,6 +112,7 @@ export default {
fileInfo: null,
starLoading: false,
isFullScreen: false,
hasLowHeight: false,
}
},
@ -226,7 +227,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,
@ -484,6 +485,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>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long