X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e3d38a12c37e706077d9a42194fb80eb05e12658..a3b1c058b5c4453838cb896aa3b8c3a803949ffb:/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 482afb9..8c2e2e1 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -9,15 +9,18 @@ define([ 'use strict'; -var Canvas = function(wlxml, publisher) { +var Canvas = function(wlxmlDocument, publisher) { this.eventBus = _.extend({}, Backbone.Events); - this.loadWlxmlDocument(wlxml); + this.loadWlxmlDocument(wlxmlDocument); this.publisher = publisher ? publisher : function() {}; }; $.extend(Canvas.prototype, { loadWlxmlDocument: function(wlxmlDocument) { + if(!wlxmlDocument) { + return false; + } var canvasDOM = this.generateCanvasDOM(wlxmlDocument.root); this.wrapper = $('
').addClass('canvas-wrapper').attr('contenteditable', true); @@ -550,8 +553,8 @@ $.extend(Cursor.prototype, { }) return { - fromXML: function(wlxmlNode, publisher) { - return new Canvas(wlxmlNode, publisher); + fromXMLDocument: function(wlxmlDocument, publisher) { + return new Canvas(wlxmlDocument, publisher); } };