diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-11-20 14:44:20 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-11-22 14:03:23 +0100 |
commit | a90b4bcc324790a24d2fa9de04ac6ecd90e99cf4 (patch) | |
tree | f8c002d8844716c8c74a8381152b2a1c5cb00c15 /apps/files/js | |
parent | ad1a026e547d2092783e545f854ea34065d0bdb2 (diff) | |
download | nextcloud-server-a90b4bcc324790a24d2fa9de04ac6ecd90e99cf4.tar.gz nextcloud-server-a90b4bcc324790a24d2fa9de04ac6ecd90e99cf4.zip |
Do not switch to root folder if filelist is already shown
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>
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/filelist.js | 9 | ||||
-rw-r--r-- | apps/files/js/navigation.js | 7 |
2 files changed, 13 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 047837cd9d7..7a8a8b80e10 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -653,8 +653,13 @@ */ _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; }, diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js index b3648fedc6c..02a0af2b369 100644 --- a/apps/files/js/navigation.js +++ b/apps/files/js/navigation.js @@ -154,7 +154,12 @@ 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, |