js/foundation/view/view.js in rsence-pre-2.1.8.1 vs js/foundation/view/view.js in rsence-pre-2.2.0.0
- old
+ new
@@ -1045,10 +1045,24 @@
}
return this;
},
setStyles: function(_styles){
+ var _stylesObjType = COMM.Values.type(_styles);
+ if(_stylesObjType==='a'){
+ this.setStylesArray(_styles);
+ }
+ else if(_stylesObjType==='h'){
+ this.setStylesHash(_styles);
+ }
+ else {
+ console.log('HView#setStyles: Invalid data, expected array or hash; type: '+h+', data:',_styles);
+ }
+ return this;
+ },
+
+ setStylesArray: function(_styles){
var
_styleItem, _styleKey, _styleValue, i = 0;
for(;i<_styles.length;i++){
_styleItem = _styles[i];
_styleKey = _styleItem[0];
@@ -1056,10 +1070,20 @@
this.setStyle(_styleKey,_styleValue);
}
return this;
},
+ setStylesHash: function(_styles){
+ var
+ _styleKey, _styleValue;
+ for(_styleKey in _styles){
+ _styleValue = _styles[_styleKey];
+ this.setStyle(_styleKey,_styleValue);
+ }
+ return this;
+ },
+
/** = Description
* Returns a style of the main DOM element of the component.
* Utilizes +ELEM+ cache to perform the action.
*
* = Parameters
@@ -1250,9 +1274,12 @@
this.hide();
this.drawn = false;
this.stopAnimation();
// Delete the children first.
var _childViewId, i;
+ if(!this.views){
+ console.log('HView#die: no subviews for component name: ',this.componentName,', self:',this);
+ }
while (this.views.length !== 0) {
_childViewId = this.views[0];
this.destroyView(_childViewId);
}
// Remove this object's bindings, except the DOM element.