Fix: publishing the right element as current text element on selecting node element
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 16 Jul 2013 09:36:23 +0000 (11:36 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 16 Jul 2013 09:36:23 +0000 (11:36 +0200)
modules/documentCanvas/canvas/canvas.js

index 3f6599a..f80e961 100644 (file)
@@ -216,7 +216,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', element);
+                this.publisher('currentTextElementSet', textElementToLand);
         } else {
             document.getSelection().removeAllRanges();
         }