Sha256: 04185e77951666e9841bdd5ca170ee5da983cfd92b08a79602614ca5777eaffc

Contents?: true

Size: 890 Bytes

Versions: 63

Compression:

Stored size: 890 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: '<%= j sanitize(@element.preview_text) %>'});
  Alchemy.growl('<%= Alchemy.t(:element_saved) %>');
  Alchemy.PreviewWindow.refresh(function() {
    Alchemy.ElementEditors.focusElementPreview(<%= @element.id %>);
  });

<%- 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

63 entries across 63 versions & 1 rubygems

Version Path
alchemy_cms-5.3.8 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.3.7 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.3.6 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.3.5 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.3.4 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.3.3 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.3.2 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.3.1 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.3.0 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.2.7 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.2.6 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.1.10 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.0.10 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-4.6.7 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.2.5 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.1.9 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.0.9 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-4.6.6 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.2.4 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-5.1.8 app/views/alchemy/admin/elements/update.js.erb