canvas manager wip - setting cursor at the beginning of a new node
[fnpeditor.git] / modules / documentCanvas / canvas.js
index dc64cac..20c286a 100644 (file)
@@ -9,13 +9,14 @@ define([
 'use strict';\r
 \r
 var Canvas = function(xml) {\r
-    this.xml = xml;\r
     this.dom = $(template);\r
-    \r
-    this.content = this.dom.find('#rng-module-documentCanvas-content')\r
-    \r
-    \r
-    this.content.html(transformations.fromXML.getHTMLTree(xml));\r
+    this.content = this.dom.find('#rng-module-documentCanvas-content');\r
+    this.setXML(xml);\r
+}\r
+\r
+Canvas.prototype.setXML = function(xml) {\r
+    this.xml = xml;\r
+    this.content.html(transformations.fromXML.getHTMLTree(xml));  \r
 }\r
 \r
 Canvas.prototype.toXML = function() {\r
@@ -102,6 +103,7 @@ Canvas.prototype.splitNode = function(options) {
         newNode.append(node)\r
     });\r
     nodeToSplit.after(newNode);\r
+    return newNode;\r
 }\r
 \r
 Canvas.prototype.createList = function(options) {\r