Skip to content

Commit bb799d3

Browse files
committed
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 d65fd72 commit bb799d3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

3rdparty

Submodule 3rdparty updated 1239 files

apps/files/js/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
dir: e.dir ? e.dir : '/'
322322
};
323323
this._changeUrl(params.view, params.dir);
324-
OC.Apps.hideAppSidebar($('.detailsView'));
324+
OCA.Files.Sidebar.close();
325325
this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params));
326326
window._nc_event_bus.emit('files:navigation:changed')
327327
}
@@ -352,7 +352,7 @@
352352
_onChangeViewerMode: function(e) {
353353
var state = !!e.viewerModeEnabled;
354354
if (e.viewerModeEnabled) {
355-
OC.Apps.hideAppSidebar($('.detailsView'));
355+
OCA.Files.Sidebar.close();
356356
}
357357
$('#app-navigation').toggleClass('hidden', state);
358358
$('.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)