mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
11068: add confirm_actions to close the modal
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
confirm_button_class: :red,
|
||||
actions_alignment_class: 'justify-end',
|
||||
confirm_reflexes: "click->products#delete_#{object_type}",
|
||||
confirm_actions: "click->modal#close",
|
||||
)
|
||||
= render delete_modal do
|
||||
%h2.margin-bottom-20.black-text
|
||||
|
||||
@@ -10,11 +10,7 @@ export default class extends ApplicationController {
|
||||
this.stimulate("Products#fetch");
|
||||
}
|
||||
|
||||
beforeReflex(element) {
|
||||
// To prevent the double click on the confirm modal's confirmation button
|
||||
if (element.id === "modal-confirm-button") {
|
||||
window.dispatchEvent(new Event("modal:close"));
|
||||
}
|
||||
beforeReflex() {
|
||||
this.showLoading();
|
||||
this.scrollToElement();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user