From e7456824103846b3cc9857d3f05f2db09bb0abab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 3 Apr 2014 12:21:23 +0200 Subject: [PATCH 1/1] editor: refactoring --- .../modules/documentCanvas/canvas/documentElement.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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() { -- 2.20.1