From f717bed085b7ef8c1cc4bb982c63193a2c8bbdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 3 Oct 2018 10:59:31 +0200 Subject: [PATCH 01/42] Grid init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/css/files.scss | 34 ++++++++++++++++++++++++++++++++++ apps/files/js/filelist.js | 10 ++++++++++ apps/files/templates/list.php | 2 +- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss index 5d8a20d86a66a..ed15865b32af1 100644 --- a/apps/files/css/files.scss +++ b/apps/files/css/files.scss @@ -726,3 +726,37 @@ table.dragshadow td.size { height: 30px; line-height: 30px; } + +/* GRID */ +#filestable.view-grid { + display: flex; + flex-direction: column; + thead { + display: none; + } + tbody { + display: grid; + grid-template-columns: repeat(auto-fill, 180px); + justify-content: space-around; + row-gap: 15px; + tr { + display: block; + height: 180px; + } + td { + display: block; + &.selection { + position: absolute; + top: 0; + left: 0; + display: flex; + width: 44px; + label { + width: 44px; + height: 44px; + display: inline-block; + } + } + } + } +} \ No newline at end of file diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 94052b10b331e..2f61fe71db2bd 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -327,6 +327,9 @@ this.$el.find('thead th .columntitle').click(_.bind(this._onClickHeader, this)); + // Toggle for grid view + $('#view-button').on('click', this._onGridToggle); + this._onResize = _.debounce(_.bind(this._onResize, this), 250); $('#app-content').on('appresized', this._onResize); $(window).resize(this._onResize); @@ -587,6 +590,13 @@ this.$table.find('>thead').width($('#app-content').width() - OC.Util.getScrollBarWidth()); }, + /** + * Event handler for grid view toggle + */ + _onGridToggle: function() { + $('.list-container').toggleClass('view-grid'); + }, + /** * Event handler when leaving previously hidden state */ diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index 9cae72a176f5b..f9cd5a2529d64 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -38,7 +38,7 @@

- +