Skip to content

Commit

Permalink
Faster nestable element creation
Browse files Browse the repository at this point in the history
If only one nestable element is available for a parent element, then the button immediately creates the element instead of opening a select element dialog.
  • Loading branch information
tvdeyen committed Oct 1, 2018
1 parent 272f932 commit da53dd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/alchemy/admin/elements/_element.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<%= f.hidden_field :name %>
<%= f.hidden_field :page_id, value: element.page_id %>
<%= f.hidden_field :parent_element_id, value: element.id %>
<button class="button with_icon add-nestable-element-button" data-alchemy-button>
<button class="button add-nestable-element-button" data-alchemy-button>
<%= Alchemy.t(:add_nested_element) % { name: Alchemy.t(nestable_element, scope: 'element_names') } %>
</button>
<% end %>
Expand All @@ -58,7 +58,7 @@
), {
size: "320x125",
title: Alchemy.t("New Element")
}, class: "button with_icon add-nestable-element-button" %>
}, class: "button add-nestable-element-button" %>
<% end %>
<% end %>
</div>
Expand Down

0 comments on commit da53dd7

Please sign in to comment.