js/foundation/control/valueaction/valueaction.js in rsence-pre-2.3.0.1 vs js/foundation/control/valueaction/valueaction.js in rsence-pre-2.3.0.2

- old
+ new

@@ -7,10 +7,17 @@ */ var HValueAction = HClass.extend({ constructor: function( _rect, _parent, _options ){ + if( _rect && _rect.hasAncestor && _rect.hasAncestor( HClass ) ){ + _options = _parent; + _parent = _rect; + } + else { + console.warn && console.warn( "Warning: the rect constructor argument of HValueAction is deprecated:",_rect ); + } this.parent = _parent; this.options = _options; if( _options.value ){ this.value = _options.value; } @@ -28,10 +35,10 @@ _viewPIdx = this.parent.views.indexOf(this.viewId); this.parent.views.splice(_viewPIdx,1); HSystem.delView(this.viewId); this.parent.viewsZOrder.splice( _viewZIdx, 1 ); var _sysUpdateZIndexOfChildrenBufferIndex = HSystem._updateZIndexOfChildrenBuffer.indexOf( this.viewId ); - if(_sysUpdateZIndexOfChildrenBufferIndex !== -1){ + if(~_sysUpdateZIndexOfChildrenBufferIndex){ HSystem._updateZIndexOfChildrenBuffer.splice( _sysUpdateZIndexOfChildrenBufferIndex, 1 ); } this.parent = null; this.parents = []; }