Sha256: aec5e70de7d3f4ded4e1ad49194752c9f17c718f53e9df3126dd025bc9f5b3ff

Contents?: true

Size: 1.61 KB

Versions: 20

Compression:

Stored size: 1.61 KB

Contents

(function() {
  var $el;
  var $element_area;
  var element_html = '<%= j render(Alchemy::ElementEditor.new(@element)) %>';

<%- if @cut_element_id -%>
  $('.element-editor[data-element-id="<%= @cut_element_id %>"]').remove();
<%- end -%>

<% if @element.fixed? %>
  if ($('#fixed-elements').length == 0) {
    Alchemy.FixedElements.buildTabs('<%= Alchemy.t(:main_content) %>');
  }
  Alchemy.FixedElements.createTab('<%= @element.id %>', '<%= @element.display_name %>');
  $element_area = $('#fixed-element-<%= @element.id %>');
<% elsif @element.parent_element %>
  $element_area = $('#element_<%= @element.parent_element_id %> > .nestable-elements > .nested-elements');
  Alchemy.Buttons.enable('.nestable-elements');
<% else %>
  $element_area = $('#main-content-elements');
<% end %>

<%- if @insert_at_top -%>
  $element_area.prepend(element_html);
<%- else -%>
  $element_area.append(element_html);
<%- end -%>

  if ($element_area.find('.element-editor').length > 0) {
    Alchemy.SortableElements(<%= @page.id %>, '<%= form_authenticity_token %>', $element_area);
  } else {
    $element_area.sortable('refresh');
  }

  Alchemy.growl('<%= Alchemy.t(:successfully_added_element) %>');
  Alchemy.closeCurrentDialog();
  Alchemy.Tinymce.init(<%= @element.richtext_ingredients_ids.to_json %>);
  Alchemy.PreviewWindow.refresh(function() {
    Alchemy.ElementEditors.focusElementPreview(<%= @element.id %>);
  });

  $el = $('#element_<%= @element.id %>');
  $el.trigger('FocusElementEditor.Alchemy');
  Alchemy.GUI.initElement($el);

<%- if @clipboard.blank? -%>
  $('#clipboard_button .icon.clipboard').removeClass('full');
<%- end -%>
})();

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
alchemy_cms-7.0.15 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.14 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.13 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.12 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.11 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.10 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.9 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.8 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.7 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.6 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.5 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.4 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.3 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.2 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.1 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.0 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.0.pre.rc1 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.0.pre.c app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.0.pre.b app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-7.0.0.pre.a app/views/alchemy/admin/elements/create.js.erb