Fixing selection of a new node after insert
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 18 Jun 2013 09:39:51 +0000 (11:39 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 18 Jun 2013 09:39:51 +0000 (11:39 +0200)
modules/documentCanvas/documentCanvas.js

index bd959fe..51acbf3 100644 (file)
@@ -84,7 +84,7 @@ return function(sandbox) {
                 anchor.before(newNode)\r
             else\r
                 anchor.after(newNode);\r
-            this.selectNode(newNode);\r
+            this.selectNode(new wlxmlNode.Node(newNode), {moveCarret: true});\r
             //isDirty = true;\r
             sandbox.publish('contentChanged');\r
         },\r
@@ -108,7 +108,7 @@ return function(sandbox) {
                 newNode.before(prefix);\r
                 newNode.after(suffix);\r
                 \r
-                this.selectNode(newNode);\r
+                this.selectNode(new wlxmlNode.Node(newNode), {moveCarret: true});\r
                 //isDirty = true;\r
                 sandbox.publish('contentChanged');\r
             }\r
@@ -135,7 +135,7 @@ return function(sandbox) {
                 newNode.before(prefixNode);\r
                 newNode.after(suffixNode);\r
                 \r
-                this.selectNode(newNode);\r
+                this.selectNode(new wlxmlNode.Node(newNode), {moveCarret: true});\r
                 //isDirty = true;\r
                 sandbox.publish('contentChanged');\r
             }\r