Sha256: 0293f328fed00e498977db116656e2112bb09711d6985f76e6f397d8b3eb9038

Contents?: true

Size: 950 Bytes

Versions: 6

Compression:

Stored size: 950 Bytes

Contents

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

<%- if @element_validated -%>

  $errors.hide();
  $el.trigger('SaveElement.Alchemy', {previewText: '<%= sanitize(@element.preview_text) %>'});
  Alchemy.growl('<%= Alchemy.t(:element_saved) %>');
  Alchemy.PreviewWindow.refresh(function() {
    Alchemy.ElementEditors.selectElementInPreview(<%= @element.id %>);
  });
  <%= update_essence_select_elements(@page, @element) -%>

<%- else -%>

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

<%- end -%>

})();

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alchemy_cms-3.3.3 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-3.3.2 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-3.4.0.rc1 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-3.3.1 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-3.3.0 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-3.3.0.rc2 app/views/alchemy/admin/elements/update.js.erb