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>
This commit is contained in:
Julius Härtl 2018-11-20 14:44:20 +01:00
parent ad1a026e54
commit a90b4bcc32
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
2 changed files with 13 additions and 3 deletions

View File

@ -653,8 +653,13 @@
*/ */
_onShow: function(e) { _onShow: function(e) {
if (this.shown) { if (this.shown) {
this._setCurrentDir('/', false); if (e.itemId === this.id) {
this.reload(); 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; this.shown = true;
}, },

View File

@ -154,7 +154,12 @@
this.$currentContent = $('#app-content-' + (typeof itemView === 'string' && itemView !== '' ? itemView : itemId)); this.$currentContent = $('#app-content-' + (typeof itemView === 'string' && itemView !== '' ? itemView : itemId));
this.$currentContent.removeClass('hidden'); this.$currentContent.removeClass('hidden');
if (!options || !options.silent) { 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( this.$el.trigger(
new $.Event('itemChanged', { new $.Event('itemChanged', {
itemId: itemId, itemId: itemId,