Sha256: 836397a59aec0d3d5877ed785cf847f1fb6e6cc83fe23d4bb63fb17685184e20

Contents?: true

Size: 1.23 KB

Versions: 9

Compression:

Stored size: 1.23 KB

Contents

(function($) {

  var $el = $('#element_<%= @element.id -%>');

  <%- if @element_validated -%>

  $('div.element_handle span.icon', $el).removeClass('element_<%= @element.public? ? "draft" : "public" -%>').addClass('element_<%= @element.public? ? "public" : "draft" -%>');
  $('.element_heading .preview_text_element_name', $el).text('<%= @element.display_name -%>');
  $('.element_heading .preview_text_quote', $el).text('<%= escape_javascript(@element.preview_text) -%>');
  $('div.content_editor').removeClass('validation_failed');
  $("#element_<%= @element.id -%>_errors").hide();
  Alchemy.setElementSaved($el);
  Alchemy.growl('<%= t("element_saved") -%>');
  Alchemy.PreviewWindow.refresh();

  <%- else -%>

  Alchemy.growl('<%= escape_javascript(@notice) %>', 'warn');
  $('#element_<%= @element.id %>_errors').html('<%= @error_message %><ul><li><%= @element.essence_error_messages.join("</li><li>").html_safe %></li></ul>');
  $("#element_<%= @element.id %>_errors").show();
  $('div.content_editor').removeClass('validation_failed');
  $('<%= @element.contents_with_errors.map { |content| "#" + content_dom_id(content) }.join(", ") %>').addClass('validation_failed');
  Alchemy.enableButton('button.button', $el);
  
  <%- end -%>

})(jQuery);

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-2.2.rc14 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-2.2.rc13 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-2.2.rc11 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-2.2.rc8 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-2.2.rc7 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-2.2.rc6 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-2.2.rc3 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-2.2.rc2 app/views/alchemy/admin/elements/update.js.erb
alchemy_cms-2.2.rc1 app/views/alchemy/admin/elements/update.js.erb