diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 047837cd9d..7a8a8b80e1 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 b3648fedc6..02a0af2b36 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,