X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0c978bca67983e93096a8e744b53e50861a9333d..7a67ffc356936a4eec4243df03fab2ad1c66c9b9:/src/editor/modules/documentCanvas/canvas/canvas.js?ds=inline diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index b6ddf71..d13e2ea 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.transform('smartxml.setText', {text: 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) {