Clear selection on reload (when changing sort)

This commit is contained in:
Vincent Petry 2014-04-29 18:49:11 +02:00
parent 535302b25e
commit 61db16321f
2 changed files with 9 additions and 2 deletions

View File

@ -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();

View File

@ -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() {