Allow clicking on checkboxes for batch update

This commit is contained in:
Sebastian Serth
2023-11-24 16:41:49 +01:00
parent 1fb5e45202
commit 0bd7c93d65
2 changed files with 10 additions and 6 deletions

View File

@ -314,18 +314,18 @@ GEM
pundit (2.3.1)
activesupport (>= 3.0.0)
racc (1.7.3)
rack (3.0.8)
rack (2.2.8)
rack-mini-profiler (3.1.1)
rack (>= 1.2.0)
rack-proxy (0.7.7)
rack
rack-session (2.0.0)
rack (>= 3.0.0)
rack-session (1.0.1)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.2)
actioncable (= 7.1.2)
actionmailbox (= 7.1.2)

View File

@ -134,6 +134,10 @@ $(document).on('turbolinks:load', function () {
class: 'form-check-input',
});
td.on('click', function (event) {
if (event.target !== this) {
// We don't want to trigger the handler when clicking directly on the checkbox.
return;
}
event.preventDefault();
checkbox.prop('checked', !checkbox.prop('checked'));
});