diff --git a/app/components/confirm_modal_component.rb b/app/components/confirm_modal_component.rb index d942ed5551..3a73af0e68 100644 --- a/app/components/confirm_modal_component.rb +++ b/app/components/confirm_modal_component.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true class ConfirmModalComponent < ModalComponent - def initialize(id:, confirm_actions: nil, controllers: nil, message: nil) + def initialize(id:, confirm_actions: nil, controllers: nil, message: nil, confirm_reflexes: nil) super(id: id, close_button: true) @confirm_actions = confirm_actions + @confirm_reflexes = confirm_reflexes @controllers = controllers @message = message end diff --git a/app/components/confirm_modal_component/confirm_modal_component.html.haml b/app/components/confirm_modal_component/confirm_modal_component.html.haml index 7da8ccebc6..0c507885ce 100644 --- a/app/components/confirm_modal_component/confirm_modal_component.html.haml +++ b/app/components/confirm_modal_component/confirm_modal_component.html.haml @@ -7,4 +7,4 @@ .modal-actions %input{ class: "button icon-plus #{close_button_class}", type: 'button', value: t('js.admin.modals.cancel'), "data-action": "click->modal#close" } - %input{ class: "button icon-plus primary", type: 'button', value: t('js.admin.modals.confirm'), "data-action": @confirm_actions } + %input{ class: "button icon-plus primary", type: 'button', value: t('js.admin.modals.confirm'), "data-action": @confirm_actions, "data-reflex": @confirm_reflexes }