diff options
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 83510762c1a..94fdada937d 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -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); }, /** |