From f717bed085b7ef8c1cc4bb982c63193a2c8bbdec Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Wed, 3 Oct 2018 10:59:31 +0200 Subject: 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/js/filelist.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/files/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 94052b10b33..2f61fe71db2 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 */ -- cgit v1.2.3