Sha256: a70be1adec7d74a2025a6a9d6f3fcce020809653eb6ba5fba10537261fcf3ed3

Contents?: true

Size: 1.08 KB

Versions: 27

Compression:

Stored size: 1.08 KB

Contents

(function() {
  var $el = $('#element_<%= @element.id %>');
  $('.content_editor', $el).removeClass('validation_failed');

<%- if @element_validated -%>

  $('.element_head', $el).replaceWith('<%= j render("element_head", element: @element) %>');
  Alchemy.ElementEditors.reinit($el);
  $("#element_<%= @element.id %>_errors").hide();
  Alchemy.setElementSaved($el);
  Alchemy.growl('<%= _t(:element_saved) %>');
  Alchemy.PreviewWindow.refresh(function() {
    Alchemy.ElementEditors.selectElementInPreview(<%= @element.id %>);
  });
  <%= update_essence_select_elements(@page, @element) -%>

<%- else -%>

  Alchemy.growl('<%= j @notice %>', 'warn');
  $('#element_<%= @element.id %>_errors').html('<%= j @error_message %><ul><li><%== j @element.essence_error_messages.join("</li><li>") %></li></ul>');
  $("#element_<%= @element.id %>_errors").show();
  $('<%= @element.contents_with_errors.map { |content| "#" + content.dom_id }.join(", ") %>').addClass('validation_failed');
  Alchemy.ElementEditors.scrollToElement('#element_<%= @element.id %>');
  Alchemy.Buttons.enable($el);

<%- end -%>

})();

Version data entries

27 entries across 27 versions & 2 rubygems

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