From 3f36548a6d7c67857bf8fed1de7a81828e4c14a3 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 20 Apr 2017 14:59:08 +0200 Subject: Reload file list when leaving hidden state Whenever a file list is already initialized and was hidden when switching to another file list in the navigation bar, if the user comes back to this list it gets redisplayed. At this point the list needs to be refreshed to be able to reflect any potential file changes done from the other lists. --- apps/files/js/filelist.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/files/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 0fcb10a21ee..6b5b5a2daef 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -327,6 +327,7 @@ this.$fileList.on('click','td.filename>a.name, td.filesize, td.date', _.bind(this._onClickFile, this)); this.$fileList.on('change', 'td.filename>.selectCheckBox', _.bind(this._onClickFileCheckbox, this)); + this.$el.on('show', _.bind(this._onShow, this)); this.$el.on('urlChanged', _.bind(this._onUrlChanged, this)); this.$el.find('.select-all').click(_.bind(this._onClickSelectAll, this)); this.$el.find('.download').click(_.bind(this._onClickDownloadSelected, this)); @@ -552,6 +553,13 @@ this.$table.find('>thead').width($('#app-content').width() - OC.Util.getScrollBarWidth()); }, + /** + * Event handler when leaving previously hidden state + */ + _onShow: function(e) { + this.reload(); + }, + /** * Event handler for when the URL changed */ -- cgit v1.2.3