X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/edd85d12e3446e6d30ecb3b67519d53933a3b621..daeb3efce48907831ac2fc1b756845c9cb83cd41:/modules/documentCanvas/canvas.js diff --git a/modules/documentCanvas/canvas.js b/modules/documentCanvas/canvas.js index dc64cac..20c286a 100644 --- a/modules/documentCanvas/canvas.js +++ b/modules/documentCanvas/canvas.js @@ -9,13 +9,14 @@ define([ 'use strict'; var Canvas = function(xml) { - this.xml = xml; this.dom = $(template); - - this.content = this.dom.find('#rng-module-documentCanvas-content') - - - this.content.html(transformations.fromXML.getHTMLTree(xml)); + this.content = this.dom.find('#rng-module-documentCanvas-content'); + this.setXML(xml); +} + +Canvas.prototype.setXML = function(xml) { + this.xml = xml; + this.content.html(transformations.fromXML.getHTMLTree(xml)); } Canvas.prototype.toXML = function() { @@ -102,6 +103,7 @@ Canvas.prototype.splitNode = function(options) { newNode.append(node) }); nodeToSplit.after(newNode); + return newNode; } Canvas.prototype.createList = function(options) {