]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix sidebar not automatically hidden in Files app 35062/head
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Mon, 7 Nov 2022 23:53:12 +0000 (00:53 +0100)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Wed, 9 Nov 2022 19:19:30 +0000 (19:19 +0000)
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>
apps/files/js/app.js
apps/files/js/gotoplugin.js

index d6b7a79b362d732c19b539bcc03720c62fb4e6d4..687b57afc3a498470cecfdef5399f053e4dcff2a 100644 (file)
                                        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));
                        }
                },
                _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);
index 474acdab5872ad395f0df9783b7ce47c989ed953..ca1823697c4a31d3ac1f0ccf03e285001d9fb7e4 100644 (file)
@@ -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'));