Skip to content

Commit

Permalink
Make number of file list entries depending on the width for grid view
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Nov 18, 2018
1 parent 8bf7ec2 commit eb03960
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 eb03960

Please sign in to comment.