From: Aleksander Ɓukasz Date: Thu, 3 Apr 2014 10:21:23 +0000 (+0200) Subject: editor: refactoring X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/e7456824103846b3cc9857d3f05f2db09bb0abab editor: refactoring --- diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index 5a40f30..b91c3c1 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; @@ -111,7 +108,7 @@ var manipulate = function(e, params, action) { return element; }; -DocumentNodeElement.prototype = new DocumentElement(); +DocumentNodeElement.prototype = Object.create(DocumentElement.prototype); $.extend(DocumentNodeElement.prototype, { @@ -243,7 +240,7 @@ $.extend(DocumentTextElement, { } }); -DocumentTextElement.prototype = new DocumentElement(); +DocumentTextElement.prototype = Object.create(DocumentElement.prototype); $.extend(DocumentTextElement.prototype, { createDOM: function() {