forked from fixin.me/fixin.me
Disallow using onclick: action with confirm:
This commit is contained in:
parent
f76344c220
commit
35037648bd
@ -87,8 +87,8 @@ module ApplicationHelper
|
|||||||
|
|
||||||
name = svg_tag("pictograms/#{image}") + name if image
|
name = svg_tag("pictograms/#{image}") + name if image
|
||||||
html_options[:class] = class_names(html_options[:class], "button", active: current == :active)
|
html_options[:class] = class_names(html_options[:class], "button", active: current == :active)
|
||||||
if html_options[:confirm]
|
if html_options[:onclick]&.is_a? Hash
|
||||||
html_options[:onclick] = "return confirm('#{html_options.delete(:confirm)}');"
|
html_options[:onclick] = "return confirm('#{html_options[:onclick][:confirm]}');"
|
||||||
end
|
end
|
||||||
|
|
||||||
send "#{type}_to", name, options, html_options
|
send "#{type}_to", name, options, html_options
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
request.referer.present? ? :back : root_url %>
|
request.referer.present? ? :back : root_url %>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<%# TODO: make confirm dialog work %>
|
|
||||||
<%= image_button_to t(".delete"), "account-remove-outline", user_registration_path,
|
<%= image_button_to t(".delete"), "account-remove-outline", user_registration_path,
|
||||||
class: "dangerous", method: :delete, confirm: t(".confirm_delete") %>
|
class: "dangerous", method: :delete, onclick: {confirm: t(".confirm_delete")} %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user