Skip to content

Commit

Permalink
fix: checkbox now allows shift-click and multi-select
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
  • Loading branch information
emoral435 committed Feb 13, 2024
1 parent 2c6d11d commit 3022b23
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3022b23

Please sign in to comment.