Skip to content

Commit

Permalink
Do not open the sidebar automatically on small widths
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Jan 27, 2023
1 parent 0655980 commit b4876c1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -616,15 +616,21 @@ export default {
// override mimetype if existing alias
const mime = fileInfo.mime
this.currentFile = new File(fileInfo, mime, this.components[mime])
this.changeSidebar()
let openSidebar = true
if (document.documentElement.clientWidth < 1024) {
openSidebar = false
}
this.changeSidebar(openSidebar)
this.updatePreviousNext()
},
/**
* Show sidebar if available and a file is already opened
*
* @param {bool} openSidebar open the sidebar, defaults to true
*/
changeSidebar() {
if (this.sidebarFile) {
changeSidebar(openSidebar = true) {
if (this.sidebarFile && openSidebar) {
this.showSidebar()
}
},
Expand Down

0 comments on commit b4876c1

Please sign in to comment.