Comparing version 0.4.0 to 0.4.1
@@ -35,3 +35,8 @@ "use strict"; | ||
ViewBase.prototype.setChildren = function (elements) { | ||
this.rootElement.setChildren(elements); | ||
if (this._initialized) { | ||
this._children = elements; | ||
this.createChildren(); | ||
return; | ||
} | ||
this._children = elements; | ||
}; | ||
@@ -54,2 +59,7 @@ ViewBase.prototype.getChildren = function () { | ||
ViewBase.prototype.createChildren = function () { | ||
//cheking for elements lengh here because this will ensure the children of this view are overriden, only if | ||
// developer has explicitly set children on this view | ||
if (this._children && this._children.length > 0) { | ||
this.rootElement.setChildren(this._children); | ||
} | ||
this.rootElement.initialize(); | ||
@@ -63,7 +73,2 @@ }; | ||
} | ||
/* if(typeof tempVNode.type !== "string") | ||
{ | ||
throw TypeError("Custom Element cannot be the root node of a view.\n" + | ||
" Please make sure root node is html node, for example 'div','section' etc.") | ||
}*/ | ||
if (tempVNode.children) { | ||
@@ -70,0 +75,0 @@ for (var i = 0; i < tempVNode.children.length; i++) { |
{ | ||
"name": "ramajs", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"author": { | ||
@@ -32,2 +32,3 @@ "name": "" | ||
"steal": "0.16.22", | ||
"steal-tools": "^0.16.5", | ||
"typedoc": "^0.4.4", | ||
@@ -34,0 +35,0 @@ "typescript": "1.8.10", |
92822
2409
23