Sha256: 1e84096c85ea42881a1ea356f3cd9403caf680635e5538bf6e3270aad5ae6369

Contents?: true

Size: 748 Bytes

Versions: 14

Compression:

Stored size: 748 Bytes

Contents

$(document).ready(function() {

  var enableNav = function() {
    $('#editable-elements .nav a').click(function(e) {
      var index = parseInt($(this).attr('href').match(/block-(.+)/)[1]);

      $('#editable-elements .wrapper ul li.block').hide();
      $('#block-' + index).show();

      $(this).parent().find('.on').removeClass('on');
      $(this).addClass('on');

      e.preventDefault();
    });
  }

  enableNav();

  $.subscribe('form.saved.success', function(event, data) {
    if (data.editable_elements != '') {
      $('#editable-elements').replaceWith(data.editable_elements);
      enableNav();

      $('textarea.html').tinymce(TinyMceDefaultSettings);
    }
  }, []);

  $('textarea.html').tinymce(TinyMceDefaultSettings);

});

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 public/javascripts/admin/editable_elements.js
locomotive_cms-1.0.0.beta public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta12 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta11 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta10 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta9 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta8 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta7 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta5 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta4 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta3 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta2 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4.beta1 public/javascripts/admin/editable_elements.js
locomotive_cms-0.0.4 public/javascripts/admin/editable_elements.js