X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/2e14f0181735b7acd0da023eb4c9524b75a45b56..75e12ca1b25cdcdb457ee2a159a0bf4287841c63:/src/editor/modules/documentCanvas/canvas/elementsRegister.js?ds=inline diff --git a/src/editor/modules/documentCanvas/canvas/elementsRegister.js b/src/editor/modules/documentCanvas/canvas/elementsRegister.js index 24a700a..7b2cf99 100644 --- a/src/editor/modules/documentCanvas/canvas/elementsRegister.js +++ b/src/editor/modules/documentCanvas/canvas/elementsRegister.js @@ -5,9 +5,10 @@ var _ = require('libs/underscore'), wlxml = require('wlxml/wlxml'); -var ElementsRegister = function(BaseType) { +var ElementsRegister = function(BaseType, NullType) { this._register = {}; this.BaseType = BaseType; + this.NullType = NullType; }; _.extend(ElementsRegister.prototype, { @@ -21,7 +22,7 @@ _.extend(ElementsRegister.prototype, { }, register: function(params) { params.klass = params.klass || ''; - params.prototype = params.prototype || Object.create({}); + params.prototype = params.prototype || this.NullType; this._register[params.tag] = this._register[params.tag] || {}; this._register[params.tag][params.klass] = this.createCanvasElementType(params.prototype); @@ -37,9 +38,6 @@ _.extend(ElementsRegister.prototype, { } }.bind(this)); } - if(!Factory) { - Factory = this.BaseType; - } return Factory; } });