Sha256: 9f9773323594cfd217dafb98cd5220a7127dba2258e559efebfbb36573b04a61

Contents?: true

Size: 1.92 KB

Versions: 2

Compression:

Stored size: 1.92 KB

Contents

{I"
class:ETI"BundledAsset;FI"logical_path;TI"+tenon/features/tenon_content/editor.js;FI"
pathname;TI"h/Users/seanroberts/Sites/tenon/app/assets/javascripts/tenon/features/tenon_content/editor.js.coffee;FI"content_type;TI"application/javascript;TI"
mtime;Tl+;•sSI"length;Ti¾I"digest;TI"%42f98ced1e66cea8d37f106857595267;FI"source;TI"¾(function() {
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  Tenon.features.tenonContent.Editor = (function() {

    function Editor() {
      this._updateButtons = __bind(this._updateButtons, this);
      this._contentUpdated = __bind(this._contentUpdated, this);
      this._rowRemoved = __bind(this._rowRemoved, this);
      this._rowInserted = __bind(this._rowInserted, this);      $('.tenon-content').on('cocoon:after-insert', this._rowInserted);
      $('.tenon-content').on('cocoon:after-remove', this._rowRemoved);
      $(document).on('input', '.editable-text', this._contentUpdated);
      this._updateButtons();
    }

    Editor.prototype._rowInserted = function(e) {
      Tenon.mediumEditor.deactivate();
      new Tenon.features.Medium;
      return this._updateButtons();
    };

    Editor.prototype._rowRemoved = function(e) {
      return this._updateButtons();
    };

    Editor.prototype._contentUpdated = function(e) {
      var $editable;
      $editable = $(e.currentTarget);
      return $editable.next('input[type=hidden]').val($editable.html());
    };

    Editor.prototype._updateButtons = function() {
      if ($('.tn-tc-row:visible').length === 0) {
        $('#tn-tc-add-content').show();
        return $('#tn-tc-pop-out').hide();
      } else {
        $('#tn-tc-add-content').hide();
        return $('#tn-tc-pop-out').show();
      }
    };

    return Editor;

  })();

}).call(this);
;TI"required_assets_digest;TI"%166c6e8f1f3f40a59597524c5a764d36;FI"
_version;TI"%a56df69ef97ba4d9f1a23bf9b0add58a;F

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
tenon-1.0 spec/dummy/tmp/cache/assets/development/sprockets/4426ec1da04fb151ad003ea8cc0fe3be
tenon-1.0 spec/dummy/tmp/cache/assets/development/sprockets/803587439bbe988dd02352cc83c59e48