From abcbea3eac9f2ec4bcb9b8b318d67728423092c9 Mon Sep 17 00:00:00 2001 From: Eduardo Morales Date: Tue, 13 Feb 2024 12:46:03 -0600 Subject: [PATCH] fix: checkbox now allows shift-click and multi-select Signed-off-by: Eduardo Morales --- apps/files/js/filelist.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 1924cd9538e59..55608ada2667d 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -396,7 +396,7 @@ self.do_delete(filename, directory); }); - this.$fileList.on('change', 'td.selection>.selectCheckBox', _.bind(this._onClickFileCheckbox, this)); + this.$fileList.on('click', 'td.selection', _.bind(this._onClickFileCheckbox, this)); this.$fileList.on('mouseover', 'td.selection', _.bind(this._onMouseOverCheckbox, this)); this.$el.on('show', _.bind(this._onShow, this)); this.$el.on('urlChanged', _.bind(this._onUrlChanged, this)); @@ -944,8 +944,10 @@ * Event handler for when clicking on a file's checkbox */ _onClickFileCheckbox: function(e) { + // to prevent double click, prevent default + e.preventDefault() var $tr = $(e.target).closest('tr'); - if(this._getCurrentSelectionMode() === 'range') { + if(this._allowSelection && e.shiftKey) { this._selectRange($tr); } else { this._selectSingle($tr);