mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 03:46:23 +00:00
fix: avisar que se va a recargar la página cuando hay cambios en modales
This commit is contained in:
parent
aa9574fb0d
commit
6b6077f3cc
2 changed files with 8 additions and 2 deletions
|
@ -30,8 +30,8 @@
|
|||
'hx-target': "##{pluck_param(:target)}",
|
||||
'hx-validate': true,
|
||||
data: {
|
||||
controller: 'form-validation',
|
||||
action: 'form-validation#submit',
|
||||
controller: 'unsaved-changes form-validation',
|
||||
action: 'unsaved-changes#submit form-validation#submit beforeunload@window->unsaved-changes#unsaved turbolinks:before-visit@window->unsaved-changes#unsavedTurbolinks',
|
||||
'form-validation-submitting-id-value': pluck_param(:submitting, optional: true),
|
||||
'form-validation-invalid-id-value': pluck_param(:invalid, optional: true),
|
||||
}
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
options[:class] += ' edit'
|
||||
end
|
||||
|
||||
data = {}
|
||||
data[:controller] = 'unsaved-changes form-validation'
|
||||
data[:action] = 'unsaved-changes#submit form-validation#submit beforeunload@window->unsaved-changes#unsaved turbolinks:before-visit@window->unsaved-changes#unsavedTurbolinks'
|
||||
|
||||
options[:data] = data
|
||||
|
||||
%div{ id: modal_id, data: { controller: 'modal' }}
|
||||
= render 'bootstrap/modal', id: modal_id, modal_content_attributes: { class: 'h-100' } do
|
||||
- content_for :"#{modal_id}_body" do
|
||||
|
|
Loading…
Reference in a new issue