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 <[email protected]>
  • Loading branch information
szaimen committed Feb 2, 2023
1 parent 07b9dba commit e07ca6c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@
OCA.Files.Files.handleDownload(url);
}

OCA.Files.Sidebar.open(fileInfo.path);
if (document.documentElement.clientWidth > 1024) {
OCA.Files.Sidebar.open(fileInfo.path);
}
} catch (error) {
console.error(`Failed to trigger default action on the file for URL: ${location.href}`, error)
}
Expand Down Expand Up @@ -704,7 +706,9 @@

// open sidebar and set file
if (typeof show === 'undefined' || !!show || (OCA.Files.Sidebar.file !== '')) {
OCA.Files.Sidebar.open(path.replace('//', '/'))
if (fileName !== null || document.documentElement.clientWidth > 1024) {
OCA.Files.Sidebar.open(path.replace('//', '/'))
}
}
},

Expand Down Expand Up @@ -3340,7 +3344,9 @@
}
if (file.length === 1) {
_.defer(function() {
this.showDetailsView(file[0]);
if (document.documentElement.clientWidth > 1024) {
this.showDetailsView(file[0]);
}
}.bind(this));
}
this.highlightFiles(file, function($tr) {
Expand Down

0 comments on commit e07ca6c

Please sign in to comment.