diff options
-rw-r--r-- | apps/files/js/filelist.js | 8 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 28 | ||||
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 2 | ||||
-rw-r--r-- | apps/theming/tests/Controller/ThemingControllerTest.php | 8 | ||||
-rw-r--r-- | core/css/multiselect.css | 4 |
5 files changed, 40 insertions, 10 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index c53fa4f3d66..d32c3ba7c9e 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -923,7 +923,8 @@ tr, fileData, newTrs = [], - isAllSelected = this.isAllSelected(); + isAllSelected = this.isAllSelected(), + showHidden = this._filesConfig.get('showhidden'); if (index >= this.files.length) { return false; @@ -947,7 +948,10 @@ } newTrs.push(tr); index++; - count--; + // only count visible rows + if (showHidden || !tr.hasClass('hidden-file')) { + count--; + } } // trigger event for newly added rows diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 15dab3b9882..d8fc3907d78 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -1120,6 +1120,34 @@ describe('OCA.Files.FileList tests', function() { expect(fileList.files.length).toEqual(65); expect($('#fileList tr').length).toEqual(20); }); + it('renders the full first page despite hidden rows', function() { + filesConfig.set('showhidden', false); + var files = _.map(generateFiles(0, 23), function(data) { + return _.extend(data, { + name: '.' + data.name + }); + }); + // only hidden files + one visible + files.push(testFiles[0]); + fileList.setFiles(files); + expect(fileList.files.length).toEqual(25); + // render 24 hidden elements + the visible one + expect($('#fileList tr').length).toEqual(25); + }); + it('renders the full first page despite hidden rows', function() { + filesConfig.set('showhidden', true); + var files = _.map(generateFiles(0, 23), function(data) { + return _.extend(data, { + name: '.' + data.name + }); + }); + // only hidden files + one visible + files.push(testFiles[0]); + fileList.setFiles(files); + expect(fileList.files.length).toEqual(25); + // render 20 first hidden elements as visible + expect($('#fileList tr').length).toEqual(20); + }); it('renders the second page when scrolling down (trigger nextPage)', function() { // TODO: can't simulate scrolling here, so calling nextPage directly fileList._nextPage(true); diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index f274d245887..09b4a14f2b0 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -319,7 +319,7 @@ class ThemingController extends Controller { $responseCss .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . 'background-color: %s; background-position: center center; background-size:contain;' . - 'width:12px; height:12px; padding:0; margin:2px 6px 6px 9px; border-radius:1px;' . + 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . "}\n", \OC::$WEBROOT, $elementColor diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index 4325e1988b2..d9d5005e25f 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -428,7 +428,7 @@ class ThemingControllerTest extends TestCase { $expectedData .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . 'background-color: %s; background-position: center center; background-size:contain;' . - 'width:12px; height:12px; padding:0; margin:2px 6px 6px 9px; border-radius:1px;' . + 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . "}\n", \OC::$WEBROOT, $color @@ -517,7 +517,7 @@ class ThemingControllerTest extends TestCase { $expectedData .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . 'background-color: #555555; background-position: center center; background-size:contain;' . - 'width:12px; height:12px; padding:0; margin:2px 6px 6px 9px; border-radius:1px;' . + 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . "}\n", \OC::$WEBROOT ); @@ -691,7 +691,7 @@ class ThemingControllerTest extends TestCase { $expectedData .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . 'background-color: %s; background-position: center center; background-size:contain;' . - 'width:12px; height:12px; padding:0; margin:2px 6px 6px 9px; border-radius:1px;' . + 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . "}\n", \OC::$WEBROOT, $color @@ -797,7 +797,7 @@ class ThemingControllerTest extends TestCase { $expectedData .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . 'background-color: #555555; background-position: center center; background-size:contain;' . - 'width:12px; height:12px; padding:0; margin:2px 6px 6px 9px; border-radius:1px;' . + 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . "}\n", \OC::$WEBROOT ); diff --git a/core/css/multiselect.css b/core/css/multiselect.css index cc1d6a3b468..8bcbd0e563d 100644 --- a/core/css/multiselect.css +++ b/core/css/multiselect.css @@ -31,9 +31,6 @@ ul.multiselectoptions.up { ul.multiselectoptions>li { overflow: hidden; white-space: nowrap; -} - -ul.multiselectoptions > li > input[type="checkbox"]+label:before { margin-left: 7px; } ul.multiselectoptions > li input[type='checkbox']+label { @@ -106,6 +103,7 @@ ul.multiselectoptions input.new { ul.multiselectoptions > li.creator { padding: 10px; + margin: 0; font-weight: bold; } ul.multiselectoptions > li.creator > input { |