js/foundation/view/view.js in rsence-pre-2.2.0.34 vs js/foundation/view/view.js in rsence-pre-2.2.0.35

- old
+ new

@@ -1124,19 +1124,19 @@ * * = Returns * +self+ * **/ - setStyleOfPart: function(_partName, _name, _value, _cacheOverride) { + setStyleOfPart: function(_partName, _name, _value, _force) { if (!this['markupElemIds']){ console.log('Warning, setStyleOfPart: no markupElemIds'); } else if (this.markupElemIds[_partName]===undefined) { console.log('Warning, setStyleOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.'); } else { - ELEM.setStyle(this.markupElemIds[_partName], _name, _value, _cacheOverride); + ELEM.setStyle(this.markupElemIds[_partName], _name, _value, _force); } return this; }, /** = Description @@ -1149,16 +1149,16 @@ * * = Returns * The style of a specified markup element. * **/ - styleOfPart: function(_partName, _name) { + styleOfPart: function(_partName, _name, _force) { if (this.markupElemIds[_partName]===undefined) { console.log('Warning, styleOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.'); return ''; } - return ELEM.getStyle(this.markupElemIds[_partName], _name); + return ELEM.getStyle(this.markupElemIds[_partName], _name, _force); }, /** = Description * Sets a style of a specified markup element that has been bound to this * view. @@ -1187,22 +1187,82 @@ * * = Parameters * +_partName+:: The identifier of the markup element. * * = Returns - * The style of a specified markup element. + * The markup of a specified markup element. * **/ markupOfPart: function(_partName) { if (this.markupElemIds[_partName]===undefined) { console.log('Warning, markupOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.'); return ''; } return ELEM.getHTML(this.markupElemIds[_partName]); }, + +/** = Description + * Sets a element attribute of a specified markup element that has been bound to this + * view. + * + * = Parameters + * +_partName+:: The identifier of the markup element. + * +_value+:: Value for markup element. + * + * = Returns + * +self+ + * + **/ + setAttrOfPart: function( _partName, _value, _force ) { + if (this.markupElemIds[_partName]===undefined) { + console.log('Warning, setAttrOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.'); + } + else { + ELEM.setAttr( this.markupElemIds[_partName], _value, _force ); + } + return this; + }, + +/** = Description + * Returns a element attribute of a specified markup element that has been bound to this + * view. + * + * = Parameters + * +_partName+:: The identifier of the markup element. + * + * = Returns + * The attribute of a specified markup element. + * + **/ + attrOfPart: function(_partName, _force) { + if (this.markupElemIds[_partName]===undefined) { + console.log('Warning, attrOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.'); + return ''; + } + return ELEM.getAttr(this.markupElemIds[_partName], _force); + }, /** = Description + * Returns a element itself of a specified markup element that has been bound to this + * view. + * + * = Parameters + * +_partName+:: The identifier of the markup element. + * + * = Returns + * The element of a specified markup element. + * + **/ + elemOfPart: function(_partName) { + if (this.markupElemIds[_partName]===undefined) { + console.log('Warning, elemOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.'); + return ''; + } + return ELEM.get( this.markupElemIds[_partName] ); + }, + +/** = Description * Hides the component's main DOM element (and its children). * * = Returns * +self+ * @@ -1887,10 +1947,11 @@ if( _default === undefined ){ _default = ''; } var _searchTarget = HLocale.components[_componentClassName], + i = 0, _key; if( _searchTarget === undefined && (typeof _componentClassName === 'string') ){ _searchTarget = HLocale.components; _attrPath = _componentClassName; _default = _attrPath; @@ -1907,10 +1968,11 @@ _searchTarget = HLocale; } if( _searchTarget[ _attrPath[0] ] === undefined ){ return _default; } - for( _key in _attrPath ){ + for( ; i < _attrPath.length; i++ ){ + _key = _attrPath[i]; if( typeof _searchTarget[_key] === 'object' ){ _searchTarget = _searchTarget[_key]; } else if( typeof _searchTarget[_key] === 'string' ){ return _searchTarget[_key];