diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 11:07:45 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 11:07:45 +0200 |
commit | 750f19340fc39e5ba03a18fa97a5e2e470e965a1 (patch) | |
tree | a95c2c0a8047baf765bbb6b042fbb37add7d9469 | |
parent | 10978a7a610139f96b1d6c9b178e05b459cc6ef6 (diff) | |
parent | 1015ca72c3efdc24a4985735d5e481356f7fb19f (diff) | |
download | nextcloud-server-750f19340fc39e5ba03a18fa97a5e2e470e965a1.tar.gz nextcloud-server-750f19340fc39e5ba03a18fa97a5e2e470e965a1.zip |
Merge pull request #19310 from owncloud/hide-sort-indicator
hide sort indicator when in multiselect mode, ref #19056
-rw-r--r-- | apps/files/css/files.css | 8 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 3 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 19 |
3 files changed, 29 insertions, 1 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css index c0701fb18b8..928eb0c778e 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -186,9 +186,15 @@ table th .sort-indicator { filter: alpha(opacity=30); opacity: .3; } -.sort-indicator.hidden { +.sort-indicator.hidden, +.multiselect .sort-indicator, +table.multiselect th:hover .sort-indicator.hidden, +table.multiselect th:focus .sort-indicator.hidden { 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 b4cc71e2d3b..7a025e772c5 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -628,6 +628,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 b3d85cf08fa..96018917c85 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2188,6 +2188,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; |