Merge pull request #12515 from nextcloud/papercut/12295/grid-view-lazy-loading

Make number of file list entries depending on the width for grid view
pull/12495/head
Morris Jobke 2018-11-19 10:52:54 +07:00 committed by GitHub
commit ea46c111a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

@ -99,7 +99,14 @@
* @return {int} page size
*/
pageSize: function() {
return Math.max(Math.ceil(this.$container.height() / 50), 1);
var isGridView = this.$showGridView.is(':checked');
var columns = 1;
var rows = Math.ceil(this.$container.height() / 50);
if (isGridView) {
columns = Math.ceil(this.$container.width() / 160);
rows = Math.ceil(this.$container.height() / 160);
}
return Math.max(columns*rows, columns);
},
/**