js/foundation/control/dyncontrol/dyncontrol.js in rsence-2.1.1 vs js/foundation/control/dyncontrol/dyncontrol.js in rsence-2.1.2
- old
+ new
@@ -429,11 +429,17 @@
* +true+
*
**/
startDrag: function(x,y,_isRightButton){
var _parent = this.parent;
- if(_parent.elemId){
+ // parent outer position
+ // parent inner position, if it has subviews with different offset.
+ if ( _parent.markupElemIds && _parent.markupElemIds.subview ) {
+ x -= ELEM._getVisibleLeftPosition( _parent.markupElemIds.subview );
+ y -= ELEM._getVisibleTopPosition( _parent.markupElemIds.subview );
+ }
+ else if(_parent.elemId){
x-=_parent.pageX();
y-=_parent.pageY();
}
this._startPoint = new HPoint(x,y);
this._startRect = new HRect( this.rect );
@@ -457,11 +463,15 @@
* +true+
*
**/
drag: function(x,y){
var _parent = this.parent;
- if(_parent.elemId){
+ if ( _parent.markupElemIds && _parent.markupElemIds.subview ) {
+ x -= ELEM._getVisibleLeftPosition( _parent.markupElemIds.subview );
+ y -= ELEM._getVisibleTopPosition( _parent.markupElemIds.subview );
+ }
+ else if(_parent.elemId){
x-=_parent.pageX();
y-=_parent.pageY();
}
if(this._actionFlag!==-1){
this._actionFns[this._actionFlag](this,x,y);
@@ -483,10 +493,14 @@
*
**/
endDrag: function(x,y,_isRightButton){
this.base();
var _parent = this.parent;
- if(_parent.elemId){
+ if ( _parent.markupElemIds && _parent.markupElemIds.subview ) {
+ x -= ELEM._getVisibleLeftPosition( _parent.markupElemIds.subview );
+ y -= ELEM._getVisibleTopPosition( _parent.markupElemIds.subview );
+ }
+ else if(_parent.elemId){
x-=_parent.pageX();
y-=_parent.pageY();
}
if(this._actionFlag!==-1){
this._actionFns[this._actionFlag](this,x,y);