X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0c978bca67983e93096a8e744b53e50861a9333d..8f3efc2235f836dd2b624d569d97a7ae0dad77ff:/src/editor/modules/documentCanvas/canvas/canvas.js diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index b6ddf71..01cb14e 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -13,7 +13,7 @@ define([ var TextHandler = function(canvas) {this.canvas = canvas; this.buffer = null}; $.extend(TextHandler.prototype, { handle: function(node, text) { - console.log('canvas text handler: ' + text); + //console.log('canvas text handler: ' + text); this.setText(text, node); return; if(!this.node) { @@ -38,7 +38,8 @@ $.extend(TextHandler.prototype, { } }, setText: function(text, node) { - this.canvas.wlxmlDocument.transform('setText', {node:node, text: text}); + //this.canvas.wlxmlDocument.transform('setText', {node:node, text: text}); + node.setText(text); } @@ -104,7 +105,7 @@ $.extend(Canvas.prototype, { mutation.target.data = mutation.target.data.replace(utils.unicode.ZWS, ''); canvas._moveCaretToTextElement(canvas.getDocumentElement(mutation.target), 'end'); } - observer.observe(canvas.d[0], config); + observer.observe(canvas.wrapper[0], config); canvas.publisher('contentChanged'); var textElement = canvas.getDocumentElement(mutation.target), @@ -119,7 +120,7 @@ $.extend(Canvas.prototype, { }); }); var config = { attributes: false, childList: false, characterData: true, subtree: true, characterDataOldValue: true}; - observer.observe(this.d[0], config); + observer.observe(this.wrapper[0], config); this.wrapper.on('mouseover', '[document-node-element], [document-text-element]', function(e) {