Skip to content

Commit 4d5d6c6

Browse files
Fix sidebar not automatically hidden in Files app
Although the Files app creates the legacy sidebar (details view) it is then replaced with the newer Vue app sidebar. Due to this ".detailsView" no longer finds an element and therefore nothing was hidden when "hideAppSidebar($('.detailsView'))" was called (for example, when changing to another section). However, "OC.Apps.hideAppSidebar()" does not properly work either with the Vue sidebar used in the Files app (once hidden the sidebar is not shown again). For simplicity, and to avoid any possible side effect in other apps from changing "OC.Apps.hideAppSidebar", now "OC.Files.Sidebar.close()" is used instead. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent 348af70 commit 4d5d6c6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/files/js/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
dir: e.dir ? e.dir : '/'
308308
};
309309
this._changeUrl(params.view, params.dir);
310-
OC.Apps.hideAppSidebar($('.detailsView'));
310+
OCA.Files.Sidebar.close();
311311
this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params));
312312
}
313313
},
@@ -337,7 +337,7 @@
337337
_onChangeViewerMode: function(e) {
338338
var state = !!e.viewerModeEnabled;
339339
if (e.viewerModeEnabled) {
340-
OC.Apps.hideAppSidebar($('.detailsView'));
340+
OCA.Files.Sidebar.close();
341341
}
342342
$('#app-navigation').toggleClass('hidden', state);
343343
$('.app-files').toggleClass('viewer-mode no-sidebar', state);

apps/files/js/gotoplugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
type: OCA.Files.FileActions.TYPE_DROPDOWN,
4646
actionHandler: function (fileName, context) {
4747
var fileModel = context.fileInfoModel;
48-
OC.Apps.hideAppSidebar($('.detailsView'));
48+
OCA.Files.Sidebar.close();
4949
OCA.Files.App.setActiveView('files', { silent: true });
5050
OCA.Files.App.fileList.changeDirectory(fileModel.get('path'), true, true).then(function() {
5151
OCA.Files.App.fileList.scrollTo(fileModel.get('name'));

0 commit comments

Comments
 (0)