diff --git a/app/views/admin/dfc_product_imports/index.html.haml b/app/views/admin/dfc_product_imports/index.html.haml
index 0bb4821cd1..f4182b55fc 100644
--- a/app/views/admin/dfc_product_imports/index.html.haml
+++ b/app/views/admin/dfc_product_imports/index.html.haml
@@ -23,7 +23,7 @@
%tr{id: supplied_product.semanticId }
%td
%label
- = form.check_box 'semanticIds[]', { checked: true, data: { "action" => "change->checked#toggleCheckbox", "checked-target" => "checkbox" } }, supplied_product.semanticId, ""
+ = form.check_box 'semanticIds[]', { checked: true, 'data-checked-target': "checkbox" }, supplied_product.semanticId, ""
= supplied_product.name
%td
- if existing_product.present?
diff --git a/app/views/admin/order_cycles/checkout_options.html.haml b/app/views/admin/order_cycles/checkout_options.html.haml
index 9810745e8d..ac0fc1abf5 100644
--- a/app/views/admin/order_cycles/checkout_options.html.haml
+++ b/app/views/admin/order_cycles/checkout_options.html.haml
@@ -36,7 +36,7 @@
distributor_shipping_method.id,
@order_cycle.distributor_shipping_methods.include?(distributor_shipping_method),
id: "order_cycle_selected_distributor_shipping_method_ids_#{distributor_shipping_method.id}",
- data: ({ "action" => "change->checked#toggleCheckbox", "checked-target" => "checkbox" } if distributor_shipping_method.shipping_method.frontend?)
+ data: ({ "checked-target" => "checkbox" } if distributor_shipping_method.shipping_method.frontend?)
= distributor_shipping_method.shipping_method.name
- distributor.shipping_methods.backend.each do |shipping_method|
%label.disabled
@@ -67,7 +67,7 @@
distributor_payment_method.id,
@order_cycle.distributor_payment_methods.include?(distributor_payment_method),
id: "order_cycle_selected_distributor_payment_method_ids_#{distributor_payment_method.id}",
- data: ({ "action" => "change->checked#toggleCheckbox", "checked-target" => "checkbox" } if distributor_payment_method.payment_method.frontend?)
+ data: ({ "checked-target" => "checkbox" } if distributor_payment_method.payment_method.frontend?)
= distributor_payment_method.payment_method.name
- distributor.payment_methods.inactive_or_backend.each do |payment_method|
%label.disabled
diff --git a/app/views/spree/admin/orders/_table_row.html.haml b/app/views/spree/admin/orders/_table_row.html.haml
index 7cc4aae10f..4027bcf6da 100644
--- a/app/views/spree/admin/orders/_table_row.html.haml
+++ b/app/views/spree/admin/orders/_table_row.html.haml
@@ -1,6 +1,6 @@
%tr{ id: dom_id(order), class: "state-#{order.state}" }
%td.align-left
- %input{type: 'checkbox', value: order.id, name: 'bulk_ids[]', "data-checked-target": "checkbox", "data-action": "change->checked#toggleCheckbox" }
+ %input{type: 'checkbox', value: order.id, name: 'bulk_ids[]', "data-checked-target": "checkbox" }
%td.align-left
= order.distributor.name
%td.align-left
diff --git a/app/webpacker/controllers/checked_controller.js b/app/webpacker/controllers/checked_controller.js
index 84589ef903..fc7ac72b18 100644
--- a/app/webpacker/controllers/checked_controller.js
+++ b/app/webpacker/controllers/checked_controller.js
@@ -8,6 +8,10 @@ export default class extends Controller {
this.toggleCheckbox();
this.allTarget.addEventListener("change", this.toggleAll.bind(this));
+
+ this.checkboxTargets.forEach((checkbox) => {
+ checkbox.addEventListener("change", this.toggleCheckbox.bind(this));
+ });
}
toggleAll() {
diff --git a/spec/javascripts/stimulus/checked_controller_test.js b/spec/javascripts/stimulus/checked_controller_test.js
index bfa0712844..1018f1ff6d 100644
--- a/spec/javascripts/stimulus/checked_controller_test.js
+++ b/spec/javascripts/stimulus/checked_controller_test.js
@@ -21,12 +21,10 @@ describe("CheckedController", () => {
`;
@@ -90,13 +88,11 @@ describe("CheckedController", () => {