X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/83989a968f6af8436bbb37f7a67b82b35a26a2ed..88fd67cfb21bf9b51d2d070de059dc4bbbab63dd:/src/editor/modules/documentCanvas/canvas/documentElement.js diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index 60e179d..02c6e19 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -10,17 +10,18 @@ define([ // DocumentElement represents a text or an element node from WLXML document rendered inside Canvas -var DocumentElement = function(htmlElement, canvas) { +var DocumentElement = function(wlxmlNode, canvas) { if(arguments.length === 0) { return; } + this.wlxmlNode = wlxmlNode; this.canvas = canvas; - this._setupDOMHandler(htmlElement); }; $.extend(DocumentElement.prototype, { _setupDOMHandler: function(htmlElement) { this.$element = $(htmlElement); + this.$element.data('canvas-element', this); }, bound: function() { return $.contains(document.documentElement, this.dom()[0]); @@ -115,38 +116,33 @@ $.extend(DocumentElement.prototype, { // DocumentNodeElement represents an element node from WLXML document rendered inside Canvas -var DocumentNodeElement = function(htmlElement, canvas) { - DocumentElement.call(this, htmlElement, canvas); -}; - -$.extend(DocumentNodeElement, { - create: function(wlxmlNode, canvas) { - var dom = $('