Sha256: fd144f9d0a7e06edcd89e8e464dee0e865d201406489b810f48958650cf03123

Contents?: true

Size: 1.98 KB

Versions: 16

Compression:

Stored size: 1.98 KB

Contents

"use strict";

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

scrivito.editors.StringEditor = (function () {
  _createClass(StringEditor, null, [{
    key: "canEdit",
    value: function canEdit(_ref) {
      var type = _ref.type;
      var tag = _ref.tag;

      return type == "string";
    }
  }]);

  function StringEditor(_ref2) {
    var attributeInfo = _ref2.attributeInfo;
    var controller = _ref2.controller;

    _classCallCheck(this, StringEditor);

    this.attributeInfo = attributeInfo;
    this.controller = controller;
  }

  _createClass(StringEditor, [{
    key: "editorWillBeActivated",
    value: function editorWillBeActivated() {
      this.controller.setDomMode('Replace');
    }
  }, {
    key: "editorWillBeDeactivated",
    value: function editorWillBeDeactivated() {}
  }, {
    key: "editorDomWasMounted",
    value: function editorDomWasMounted(domNode) {
      scrivito.editors._applyPlaceholderToElement(domNode);
      $(domNode).text(this.controller.content);
      var editorProxy = new scrivito.editors.ControllerContentProxy(domNode, this.controller);
      scrivito.editors.string_editor._activateWithProxy(editorProxy);
    }
  }, {
    key: "onClick",
    value: function onClick() {}
  }]);

  return StringEditor;
})();

if (scrivito.registerEditor) {
  scrivito.registerEditor(scrivito.editors.StringEditor);
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
scrivito_editors-1.10.0 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.10.0.rc5 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.10.0.rc4 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.10.0.rc3 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.10.0.rc2 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.10.0.rc1 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.9.1 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.9.1.rc1 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.9.0 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.9.0.rc2 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.9.0.rc1 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.8.1 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.8.1.rc1 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.8.0 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.8.0.rc2 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js
scrivito_editors-1.8.0.rc1 app/assets/javascripts/scrivito_editors/controller_api/string_editor.js