X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/436728b375888873e6e96079a73f12d8adbd7b96..34c9285ef29074d0c13cea81fbb05e93eb369b4a:/src/editor/modules/documentCanvas/canvas/documentElement.js?ds=sidebyside diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index a08788b..7acf7c8 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -133,6 +133,8 @@ $.extend(DocumentNodeElement.prototype, { this.toggleHighlight(toggle); }, + markAsCurrent: function() {}, + toggleHighlight: function(toggle) { this._container().toggleClass('highlighted-element', toggle); }, @@ -189,18 +191,14 @@ $.extend(DocumentTextElement.prototype, { this.canvas = null; return this; }, - handle: function(event) { - var toSet = event.meta.node.getText(); - if(toSet === '') { - toSet = utils.unicode.ZWS; + setText: function(text) { + if(text === '') { + text = utils.unicode.ZWS; } - if(toSet !== this.getText()) { - this.setText(toSet); + if(text !== this.getText()) { + this.dom.contents()[0].data = text; } }, - setText: function(text) { - this.dom.contents()[0].data = text; - }, getText: function(options) { options = _.extend({raw: false}, options || {}); var toret = this.dom.text();