Merge pull request #4519 from nextcloud/downstream-27703
Reload file list when leaving hidden state
This commit is contained in:
commit
10ec3fda83
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -1507,6 +1507,12 @@ describe('OCA.Files.FileList tests', function() {
|
|||
$('#app-content-files').trigger(new $.Event('urlChanged', {view: 'files', dir: '/somedir'}));
|
||||
expect(fileList.getCurrentDirectory()).toEqual('/somedir');
|
||||
});
|
||||
it('reloads the list when leaving hidden state', function() {
|
||||
var reloadStub = sinon.stub(fileList, 'reload');
|
||||
$('#app-content-files').trigger(new $.Event('show'));
|
||||
expect(reloadStub.calledOnce).toEqual(true);
|
||||
reloadStub.restore();
|
||||
});
|
||||
it('refreshes breadcrumb after update', function() {
|
||||
var setDirSpy = sinon.spy(fileList.breadcrumb, 'setDirectory');
|
||||
fileList.changeDirectory('/anothersubdir');
|
||||
|
|
Loading…
Reference in New Issue