Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
danxuliu authored and backportbot-nextcloud[bot] committed Nov 9, 2022
commit e606db168a353d38f49e2c644787b65c84c452a5
4 changes: 2 additions & 2 deletions apps/files/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
dir: e.dir ? e.dir : '/'
};
this._changeUrl(params.view, params.dir);
OC.Apps.hideAppSidebar($('.detailsView'));
OCA.Files.Sidebar.close();
this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params));
window._nc_event_bus.emit('files:navigation:changed')
}
Expand Down Expand Up @@ -338,7 +338,7 @@
_onChangeViewerMode: function(e) {
var state = !!e.viewerModeEnabled;
if (e.viewerModeEnabled) {
OC.Apps.hideAppSidebar($('.detailsView'));
OCA.Files.Sidebar.close();
}
$('#app-navigation').toggleClass('hidden', state);
$('.app-files').toggleClass('viewer-mode no-sidebar', state);
Expand Down
2 changes: 1 addition & 1 deletion apps/files/js/gotoplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
type: OCA.Files.FileActions.TYPE_DROPDOWN,
actionHandler: function (fileName, context) {
var fileModel = context.fileInfoModel;
OC.Apps.hideAppSidebar($('.detailsView'));
OCA.Files.Sidebar.close();
OCA.Files.App.setActiveView('files', { silent: true });
OCA.Files.App.fileList.changeDirectory(fileModel.get('path'), true, true).then(function() {
OCA.Files.App.fileList.scrollTo(fileModel.get('name'));
Expand Down