5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 05:36:21 +00:00

fix: avisar que se va a recargar la página cuando hay cambios en modales

This commit is contained in:
f 2024-07-11 19:19:05 -03:00
parent aa9574fb0d
commit 6b6077f3cc
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View file

@ -30,8 +30,8 @@
'hx-target': "##{pluck_param(:target)}", 'hx-target': "##{pluck_param(:target)}",
'hx-validate': true, 'hx-validate': true,
data: { data: {
controller: 'form-validation', controller: 'unsaved-changes form-validation',
action: 'form-validation#submit', 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-submitting-id-value': pluck_param(:submitting, optional: true),
'form-validation-invalid-id-value': pluck_param(:invalid, optional: true), 'form-validation-invalid-id-value': pluck_param(:invalid, optional: true),
} }

View file

@ -31,6 +31,12 @@
options[:class] += ' edit' options[:class] += ' edit'
end 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' }} %div{ id: modal_id, data: { controller: 'modal' }}
= render 'bootstrap/modal', id: modal_id, modal_content_attributes: { class: 'h-100' } do = render 'bootstrap/modal', id: modal_id, modal_content_attributes: { class: 'h-100' } do
- content_for :"#{modal_id}_body" do - content_for :"#{modal_id}_body" do