app/views/alchemy/admin/contents/create.js.erb in alchemy_cms-4.0.0.beta vs app/views/alchemy/admin/contents/create.js.erb in alchemy_cms-4.0.0.rc1
- old
+ new
@@ -1,22 +1,18 @@
+var editor_html = '<%= j(render "alchemy/essences/#{@content.essence_partial_name}_editor", {
+ content: @content,
+ options: options_from_params.symbolize_keys,
+ html_options: @html_options.symbolize_keys
+}) %>';
+
<% if params[:was_missing] %>
-$("[data-element-<%= @element.id %>-missing-content=\"<%= @content.name %>\"]").replaceWith('<%= j(
- render(
- partial: "alchemy/essences/#{@content.essence_partial_name}_editor",
- locals: @locals
- )
-) %>');
+$("[data-element-<%= @element.id %>-missing-content=\"<%= @content.name %>\"]").replaceWith(editor_html);
<% else %>
-$("<%= @content_dom_id %>").before('<%= j(
- render(
- partial: "alchemy/essences/#{@content.essence_partial_name}_editor",
- locals: @locals
- )
-) %>');
+$("<%= @content_dom_id %>").before(editor_html);
Alchemy.Buttons.enable();
Alchemy.growl('<%= j Alchemy.t("Successfully added content") % {content: @content.name_for_label} %>')
<% end %>
@@ -27,10 +23,10 @@
<% end %>
<% if @gallery_pictures %>
<% if @gallery_pictures.size > 1 %>
-$('#element_<%= @element.id %>_contents .essence_picture_editor').addClass('dragable_picture');
+$('#element_<%= @element.id %>_contents .essence_picture_editor').addClass('draggable_picture');
<% end %>
<% if !max_image_count.blank? && @gallery_pictures.size >= max_image_count %>
$("#add_picture_<%= @element.id %>").remove();
<% end %>