@@ -439,7 +439,7 @@ $.widget("ui.draggable", $.ui.mouse, {
439
439
440
440
_setContainment : function ( ) {
441
441
442
- var over , c , ce ,
442
+ var isUserScrollable , c , ce ,
443
443
o = this . options ,
444
444
document = this . document [ 0 ] ;
445
445
@@ -486,13 +486,23 @@ $.widget("ui.draggable", $.ui.mouse, {
486
486
return ;
487
487
}
488
488
489
- over = c . css ( "overflow" ) !== "hidden" ;
489
+ isUserScrollable = / ( s c r o l l | a u t o ) / . test ( c . css ( "overflow" ) ) ;
490
490
491
491
this . containment = [
492
492
( parseInt ( c . css ( "borderLeftWidth" ) , 10 ) || 0 ) + ( parseInt ( c . css ( "paddingLeft" ) , 10 ) || 0 ) ,
493
493
( parseInt ( c . css ( "borderTopWidth" ) , 10 ) || 0 ) + ( parseInt ( c . css ( "paddingTop" ) , 10 ) || 0 ) ,
494
- ( over ? Math . max ( ce . scrollWidth , ce . offsetWidth ) : ce . offsetWidth ) - ( parseInt ( c . css ( "borderRightWidth" ) , 10 ) || 0 ) - ( parseInt ( c . css ( "paddingRight" ) , 10 ) || 0 ) - this . helperProportions . width - this . margins . left - this . margins . right ,
495
- ( over ? Math . max ( ce . scrollHeight , ce . offsetHeight ) : ce . offsetHeight ) - ( parseInt ( c . css ( "borderBottomWidth" ) , 10 ) || 0 ) - ( parseInt ( c . css ( "paddingBottom" ) , 10 ) || 0 ) - this . helperProportions . height - this . margins . top - this . margins . bottom
494
+ ( isUserScrollable ? Math . max ( ce . scrollWidth , ce . offsetWidth ) : ce . offsetWidth ) -
495
+ ( parseInt ( c . css ( "borderRightWidth" ) , 10 ) || 0 ) -
496
+ ( parseInt ( c . css ( "paddingRight" ) , 10 ) || 0 ) -
497
+ this . helperProportions . width -
498
+ this . margins . left -
499
+ this . margins . right ,
500
+ ( isUserScrollable ? Math . max ( ce . scrollHeight , ce . offsetHeight ) : ce . offsetHeight ) -
501
+ ( parseInt ( c . css ( "borderBottomWidth" ) , 10 ) || 0 ) -
502
+ ( parseInt ( c . css ( "paddingBottom" ) , 10 ) || 0 ) -
503
+ this . helperProportions . height -
504
+ this . margins . top -
505
+ this . margins . bottom
496
506
] ;
497
507
this . relativeContainer = c ;
498
508
} ,
0 commit comments