diff options
-rw-r--r-- | apps/files/css/files.css | 3 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 3 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 19 |
3 files changed, 25 insertions, 0 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 5b1cd48fd49..d5ac9233239 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -190,6 +190,9 @@ table th .sort-indicator { .multiselect .sort-indicator { visibility: hidden; } +.multiselect .sort, .multiselect .sort span { + cursor: default; +} table th:hover .sort-indicator.hidden, table th:focus .sort-indicator.hidden { visibility: visible; diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 4b1b38d783c..060269c220f 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -623,6 +623,9 @@ * Event handler when clicking on a table header */ _onClickHeader: function(e) { + if (this.$table.hasClass('multiselect')) { + return; + } var $target = $(e.target); var sort; if (!$target.is('a')) { diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index c05e7c37214..31e5c410270 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2156,6 +2156,25 @@ describe('OCA.Files.FileList tests', function() { expect(fileList.files.length).toEqual(5); expect(fileList.$fileList.find('tr').length).toEqual(5); }); + it('does not sort when clicking on header whenever multiselect is enabled', function() { + var sortStub = sinon.stub(OCA.Files.FileList.prototype, 'setSort'); + + fileList.setFiles(testFiles); + fileList.findFileEl('One.txt').find('input:checkbox:first').click(); + + fileList.$el.find('.column-size .columntitle').click(); + + expect(sortStub.notCalled).toEqual(true); + + // can sort again after deselecting + fileList.findFileEl('One.txt').find('input:checkbox:first').click(); + + fileList.$el.find('.column-size .columntitle').click(); + + expect(sortStub.calledOnce).toEqual(true); + + sortStub.restore(); + }); }); describe('create file', function() { var deferredCreate; |