]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not switch to root folder if filelist is already shown 12593/head
authorJulius Härtl <jus@bitgrid.net>
Tue, 20 Nov 2018 13:44:20 +0000 (14:44 +0100)
committerBackportbot <backportbot-noreply@rullzer.com>
Thu, 22 Nov 2018 15:10:53 +0000 (15:10 +0000)
Navigating to the root folder is already handled by
OCA.Files.Navigation.setActiveItem in case the view doesn't change.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/files/js/filelist.js
apps/files/js/navigation.js

index a7dadbbab3e103080d7f2c825215fe479802ce1b..7d4dc76daf08216871db480e5314b2d1479e072d 100644 (file)
                 */
                _onShow: function(e) {
                        if (this.shown) {
-                               this._setCurrentDir('/', false);
-                               this.reload();
+                               if (e.itemId === this.id) {
+                                       this._setCurrentDir('/', false);
+                               }
+                               // Only reload if we don't navigate to a different directory
+                               if (typeof e.dir === 'undefined' || e.dir === this.getCurrentDirectory()) {
+                                       this.reload();
+                               }
                        }
                        this.shown = true;
                },
index 9fc2180c923f49a5f86c266c0f23116ae2bb1c96..db48775f0fb02c5761b79dc0de7b4cdcbb0d720d 100644 (file)
                        this.$currentContent = $('#app-content-' + (typeof itemView === 'string' && itemView !== '' ? itemView : itemId));
                        this.$currentContent.removeClass('hidden');
                        if (!options || !options.silent) {
-                               this.$currentContent.trigger(jQuery.Event('show'));
+                               this.$currentContent.trigger(jQuery.Event('show', {
+                                       itemId: itemId,
+                                       previousItemId: oldItemId,
+                                       dir: itemDir,
+                                       view: itemView
+                               }));
                                this.$el.trigger(
                                        new $.Event('itemChanged', {
                                                itemId: itemId,