X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/2546c9dabe14b77b9e97c81efb2403eb93e9f79d..f2a4c98c8681e58fb9ee794129ce66ec0b06f0be:/src/editor/modules/documentCanvas/canvas/canvas.js?ds=inline diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index 9a01457..cf63c47 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -25,15 +25,17 @@ $.extend(Canvas.prototype, { return false; } - var canvasDOM = this.generateCanvasDOM(wlxmlDocument.root); + this.wlxmlListener.listenTo(wlxmlDocument); + this.wlxmlDocument = wlxmlDocument; + this.reloadRoot(); + this.setupEventHandling(); + }, + reloadRoot: function() { + var canvasDOM = this.generateCanvasDOM(this.wlxmlDocument.root); this.wrapper.empty(); this.wrapper.append(canvasDOM); this.d = this.wrapper.children(0); - this.setupEventHandling(); - - this.wlxmlListener.listenTo(wlxmlDocument); - this.wlxmlDocument = wlxmlDocument; }, generateCanvasDOM: function(wlxmlNode) {