diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-11-19 10:52:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-19 10:52:54 +0100 |
commit | ea46c111a0b0352fc5e7ec67de25f64bcc30def0 (patch) | |
tree | 3be3789a3a0010eb03b562bee51ffacb1764ac6f /apps | |
parent | a9e7b65de85c33f121be1736acb59272c020d5b2 (diff) | |
parent | eb039608f99d24eb30a6ecae3cfe60f337572776 (diff) | |
download | nextcloud-server-ea46c111a0b0352fc5e7ec67de25f64bcc30def0.tar.gz nextcloud-server-ea46c111a0b0352fc5e7ec67de25f64bcc30def0.zip |
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
Diffstat (limited to 'apps')
-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); }, /** |