Skip to content

Commit

Permalink
Do not switch to root folder if filelist is already shown
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
juliusknorr committed Nov 22, 2018
1 parent ad1a026 commit a90b4bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
7 changes: 6 additions & 1 deletion apps/files/js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a90b4bc

Please sign in to comment.