Skip to content

Commit e07ca6c

Browse files
committed
Do not open the sidebar automatically on small widths
Signed-off-by: Simon L <szaimen@e.mail.de>
1 parent 07b9dba commit e07ca6c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

apps/files/js/filelist.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,9 @@
433433
OCA.Files.Files.handleDownload(url);
434434
}
435435

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

705707
// open sidebar and set file
706708
if (typeof show === 'undefined' || !!show || (OCA.Files.Sidebar.file !== '')) {
707-
OCA.Files.Sidebar.open(path.replace('//', '/'))
709+
if (fileName !== null || document.documentElement.clientWidth > 1024) {
710+
OCA.Files.Sidebar.open(path.replace('//', '/'))
711+
}
708712
}
709713
},
710714

@@ -3340,7 +3344,9 @@
33403344
}
33413345
if (file.length === 1) {
33423346
_.defer(function() {
3343-
this.showDetailsView(file[0]);
3347+
if (document.documentElement.clientWidth > 1024) {
3348+
this.showDetailsView(file[0]);
3349+
}
33443350
}.bind(this));
33453351
}
33463352
this.highlightFiles(file, function($tr) {

0 commit comments

Comments
 (0)