diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/filelist.js | 5 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 11d33543424..2d3e96fbd28 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -714,8 +714,6 @@ window.FileList = { previousDir: currentDir } )); - this._selectedFiles = {}; - this._selectionSummary.clear(); this.reload(); }, linkTo: function(dir) { @@ -776,6 +774,9 @@ window.FileList = { * @brief Reloads the file list using ajax call */ reload: function() { + this._selectedFiles = {}; + this._selectionSummary.clear(); + this.$el.find('#select_all').prop('checked', false); FileList.showMask(); if (FileList._reloadCall) { FileList._reloadCall.abort(); diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 0c56e7975f8..1a639805104 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -1421,6 +1421,12 @@ describe('FileList tests', function() { }); }); }); + it('resets the file selection on reload', function() { + FileList.$el.find('#select_all').click(); + FileList.reload(); + expect(FileList.$el.find('#select_all').prop('checked')).toEqual(false); + expect(FileList.getSelectedFiles()).toEqual([]); + }); }); describe('Sorting files', function() { it('Sorts by name by default', function() { |