integration wip: wrap/unwrap node commands
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / canvas.js
index ed24cee..3a662e9 100644 (file)
@@ -33,6 +33,7 @@ $.extend(Canvas.prototype, {
         this.setupEventHandling();
 
         this.wlxmlListener.listenTo(wlxmlDocument);
+        this.wlxmlDocument = wlxmlDocument;
     },
 
     generateCanvasDOM: function(wlxmlNode) {
@@ -267,7 +268,7 @@ $.extend(Canvas.prototype, {
             if(params.caretTo || !textElementToLand.sameNode(this.getCursor().getPosition().element))
                 this._moveCaretToTextElement(textElementToLand, params.caretTo); // as method on element?
             if(!(textElementToLand.sameNode(currentTextElement)))
-                this.publisher('currentTextElementSet', textElementToLand);
+                this.publisher('currentTextElementSet', textElementToLand.data('wlxmlNode'));
         } else {
             document.getSelection().removeAllRanges();
         }