Skip to content

Commit

Permalink
Merge pull request #2023 from tvdeyen/fix-delete-element-confirm
Browse files Browse the repository at this point in the history
Fix delete element confirm dialog
  • Loading branch information
tvdeyen authored Feb 15, 2021
2 parents fe4c040 + fbc4109 commit 84c9d30
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ window.Alchemy.confirmToDeleteDialog = (url, opts) ->
type: "DELETE"
error: (xhr, status, error) ->
type = if xhr.status == 403 then 'warning' else 'error'
Alchemy.pleaseWaitOverlay(false)
Alchemy.growl(xhr.responseText || error, type)
complete: () ->
Alchemy.pleaseWaitOverlay(false)

$.extend(options, opts)
Alchemy.openConfirmDialog options.message, options
6 changes: 3 additions & 3 deletions app/views/alchemy/admin/elements/_element.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
class: element.css_classes do %>

<% unless element.fixed? %>
<%= render 'alchemy/admin/elements/element_header', element: element %>
<%= render 'alchemy/admin/elements/header', element: element %>
<% end %>

<% if element.expanded? || element.fixed? %>
<%= render 'alchemy/admin/elements/element_toolbar', element: element %>
<%= render 'alchemy/admin/elements/toolbar', element: element %>

<% element.definition[:message].tap do |message| %>
<%= render_message(:info, sanitize(message)) if message %>
Expand Down Expand Up @@ -36,7 +36,7 @@
<% end %>
<% end %>

<%= render 'alchemy/admin/elements/element_footer', element: element %>
<%= render 'alchemy/admin/elements/footer', element: element %>
<% end %>
<% end %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
render_icon('trash-alt'),
Alchemy.t(:confirm_to_delete_element),
alchemy.admin_element_path(element),
method: :delete,
class: "icon_button",
remote: true
class: "icon_button"
) -%>
<label><%= Alchemy.t("Delete element") %></label>
</div>
Expand Down

0 comments on commit 84c9d30

Please sign in to comment.