X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/af9ccdd1815aea5d1489b9729287bea85519b74f..e1d56851ab750cfa9a76574f84dd94da24b2d264:/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 5a40f30..27160e7 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -11,9 +11,6 @@ define([ // DocumentElement represents a text or an element node from WLXML document rendered inside Canvas var DocumentElement = function(wlxmlNode, canvas) { - if(arguments.length === 0) { - return; - } this.wlxmlNode = wlxmlNode; this.canvas = canvas; @@ -50,10 +47,6 @@ $.extend(DocumentElement.prototype, { return other && (typeof other === typeof this) && other.dom()[0] === this.dom()[0]; }, - markAsCurrent: function() { - this.canvas.markAsCurrent(this); - }, - getVerticallyFirstTextElement: function() { var toret; this.children().some(function(child) { @@ -111,7 +104,7 @@ var manipulate = function(e, params, action) { return element; }; -DocumentNodeElement.prototype = new DocumentElement(); +DocumentNodeElement.prototype = Object.create(DocumentElement.prototype); $.extend(DocumentNodeElement.prototype, { @@ -243,7 +236,7 @@ $.extend(DocumentTextElement, { } }); -DocumentTextElement.prototype = new DocumentElement(); +DocumentTextElement.prototype = Object.create(DocumentElement.prototype); $.extend(DocumentTextElement.prototype, { createDOM: function() {