editor: refactoring
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 3 Apr 2014 10:21:23 +0000 (12:21 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 3 Apr 2014 10:32:12 +0000 (12:32 +0200)
src/editor/modules/documentCanvas/canvas/documentElement.js

index 5a40f30..b91c3c1 100644 (file)
@@ -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() {