Skip to content

Commit

Permalink
Merge pull request #12515 from nextcloud/papercut/12295/grid-view-laz…
Browse files Browse the repository at this point in the history
…y-loading

Make number of file list entries depending on the width for grid view
  • Loading branch information
MorrisJobke authored Nov 19, 2018
2 parents a9e7b65 + eb03960 commit ea46c11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},

/**
Expand Down

0 comments on commit ea46c11

Please sign in to comment.