diff --git a/app/assets/javascripts/alchemy/alchemy.base.js.coffee b/app/assets/javascripts/alchemy/alchemy.base.js.coffee index 71272ecf6d..8e7956b1e3 100644 --- a/app/assets/javascripts/alchemy/alchemy.base.js.coffee +++ b/app/assets/javascripts/alchemy/alchemy.base.js.coffee @@ -64,8 +64,7 @@ $.extend Alchemy, $element = $form_field.closest(".element-editor") if $form_field[0] $form_field.val "" - $form_field.prev().remove() - $form_field.parent().html '' + $element.find(".thumbnail_background").html('') Alchemy.setElementDirty $element false diff --git a/app/views/alchemy/essences/_essence_picture_editor.html.erb b/app/views/alchemy/essences/_essence_picture_editor.html.erb index e3815e62dc..4962b71289 100644 --- a/app/views/alchemy/essences/_essence_picture_editor.html.erb +++ b/app/views/alchemy/essences/_essence_picture_editor.html.erb @@ -24,7 +24,6 @@
<%- if content.ingredient -%> <%= essence_picture_thumbnail(content, options) %> - <%= hidden_field_tag content.form_field_name(:picture_id), content.ingredient.id %> <% else %> <%= render_icon(:image, style: 'regular') %> <% end %> @@ -43,6 +42,8 @@ } %>
+ <%= hidden_field_tag content.form_field_name(:picture_id), + content.ingredient.try!(:id) %> <%= hidden_field_tag content.form_field_name(:link), content.essence.link %> <%= hidden_field_tag content.form_field_name(:link_title),