Sha256: bbfcb2350073abb88965bcd92fb615284a45c6b083fd7a9f1e242bf726da5d18

Contents?: true

Size: 1.22 KB

Versions: 16

Compression:

Stored size: 1.22 KB

Contents

(function($) {
  
  var $el = $('.element_editor[data-element-id="<%= @element.id %>"]');

  <%- if @error -%>
  
  $("#element_<%= @element.id -%>_folder_spinner").replaceWith("<span class='error_icon' title='<%= @error -%>'>!</span>");
  
  <%- else -%>
  
  $el = $el.replaceWith('<%= escape_javascript render(:partial => "element", :object => @element) -%>');
  $('#element_area .sortable_cell').sortable('refresh');
  Alchemy.ElementEditorSelector.reinit('.element_editor[data-element-id="<%= @element.id %>"]');

  <%- if @element.folded -%>
    
    <%- @element.rtf_contents.each do |content| -%>
    rtf_<%= content.id -%> = tinymce.get('<%= content.form_field_id -%>');
    if (rtf_<%= content.id -%>) {
      rtf_<%= content.id -%>.remove();
    };
    delete rtf_<%= content.id -%>;
    <%- end -%>
    
  <%- else -%>
    
    $el.trigger('Alchemy.SelectElementEditor');
    Alchemy.SelectBox('select', $el);
    
    <%- @element.rtf_contents.each do |content| -%>
    Alchemy.Tinymce.addEditor('<%= content.form_field_id -%>');
    <%- end -%>
    
    Alchemy.ElementDirtyObserver($el);
    Alchemy.Datepicker('input[type="date"]', $el);
    Alchemy.ButtonObserver('button.button', $el);
  <%- end -%>
  
  <%- end -%>
  
})(jQuery);

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
alchemy_cms-2.1.12 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.1.11 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.2.rc13 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.2.rc11 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.2.rc8 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.2.rc7 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.1.9.1 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.1.9 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.2.rc6 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.1.8.1 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.2.rc3 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.1.8 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.2.rc2 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.2.rc1 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.1.7 app/views/alchemy/admin/elements/fold.js.erb
alchemy_cms-2.1.6 app/views/alchemy/admin/elements/fold.js.erb