Sha256: 0c2c4344aac76c97792e599bde1f5e425222c0a3f5a19915d37887f32eb198f7

Contents?: true

Size: 1.39 KB

Versions: 25

Compression:

Stored size: 1.39 KB

Contents

(function() {
  var $el;
  var $element_area;
  var element_html = '<%= j render("element", element: @element, draggable: true) %>';

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

<%- if @page.can_have_cells? -%>
  if ($('#cells').length == 0) {
    Alchemy.buildTabbedCells('<%= _t(:main_content) %>');
  }
  Alchemy.selectOrCreateCellTab('<%= @cell_name %>', '<%= @cell.nil? ? _t(:main_content) : @cell.name_for_label %>');
<%- end -%>

  $element_area = $('#cell_<%= @cell_name %>');

<%- 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('<%= _t(:successfully_added_element) %>');
  Alchemy.closeCurrentDialog();
  Alchemy.Tinymce.init(<%= @element.richtext_contents_ids.to_json %>);
  Alchemy.PreviewWindow.refresh();
  Alchemy.ElementEditors.init();

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

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

  <%= update_essence_select_elements(@page, @element) -%>
})();

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
alchemy_cms-3.2.1 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.3 app/views/alchemy/admin/elements/create.js.erb
lc_alchemy_cms-3.2.1 app/views/alchemy/admin/elements/create.js.erb
lc_alchemy_cms-3.2.0 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.2.0 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.2.0.rc1 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.2.0.beta app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.1 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.0.4 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.rc3 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.rc2 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.rc1 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.beta6 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.beta5 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.beta4 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.0.3 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.beta3 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.beta2 app/views/alchemy/admin/elements/create.js.erb
alchemy_cms-3.1.0.beta1 app/views/alchemy/admin/elements/create.js.erb