summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2022-11-08 00:53:12 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-11-09 19:10:46 +0000
commit66d58d6eebafc944bf93d213a3bbed72dca77327 (patch)
tree4d9c2e89c6f29c5cb2241a5b8bb53e29e6ed9e0a /apps
parentb5b7a41948b63775a00aee5d4a90c4914896021d (diff)
downloadnextcloud-server-66d58d6eebafc944bf93d213a3bbed72dca77327.tar.gz
nextcloud-server-66d58d6eebafc944bf93d213a3bbed72dca77327.zip
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>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/app.js4
-rw-r--r--apps/files/js/gotoplugin.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js
index dcc294975b9..4f335a5b04a 100644
--- a/apps/files/js/app.js
+++ b/apps/files/js/app.js
@@ -321,7 +321,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')
}
@@ -352,7 +352,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);
diff --git a/apps/files/js/gotoplugin.js b/apps/files/js/gotoplugin.js
index 474acdab587..ca1823697c4 100644
--- a/apps/files/js/gotoplugin.js
+++ b/apps/files/js/gotoplugin.js
@@ -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'));