@@ -481,27 +481,36 @@ $.widget( "ui.draggable", $.ui.draggable, {
481
481
} ,
482
482
483
483
_setContainment : function ( event , ui ) {
484
- var offset , left , top ,
484
+ var offset , left , top , bottom , right ,
485
485
container = this . _getContainer ( ) ;
486
486
487
487
if ( ! container ) {
488
488
this . containment = null ;
489
489
return ;
490
490
}
491
491
492
- offset = container . offset ( ) ;
493
- left = offset . left +
494
- ( parseFloat ( $ . css ( container [ 0 ] , "borderLeftWidth" , true ) ) || 0 ) +
495
- ( parseFloat ( $ . css ( container [ 0 ] , "paddingLeft" , true ) ) || 0 ) ;
496
- top = offset . top +
497
- ( parseFloat ( $ . css ( container [ 0 ] , "borderTopWidth" , true ) ) || 0 ) +
498
- ( parseFloat ( $ . css ( container [ 0 ] , "paddingTop" , true ) ) || 0 ) ;
492
+ if ( $ . isArray ( container ) ) {
493
+ offset = container . offset ( ) ;
494
+ left = offset . left +
495
+ ( parseFloat ( $ . css ( container [ 0 ] , "borderLeftWidth" , true ) ) || 0 ) +
496
+ ( parseFloat ( $ . css ( container [ 0 ] , "paddingLeft" , true ) ) || 0 ) ;
497
+ top = offset . top +
498
+ ( parseFloat ( $ . css ( container [ 0 ] , "borderTopWidth" , true ) ) || 0 ) +
499
+ ( parseFloat ( $ . css ( container [ 0 ] , "paddingTop" , true ) ) || 0 ) ;
500
+ right = left + container . width ( ) ;
501
+ bottom = top + container . height ( ) ;
502
+ } else {
503
+ left = container [ 0 ] ;
504
+ top = container [ 1 ] ;
505
+ right = container [ 2 ] ;
506
+ bottom = container [ 3 ] ;
507
+ }
499
508
500
509
this . containment = {
501
510
left : left ,
502
511
top : top ,
503
- right : left + container . width ( ) ,
504
- bottom : top + container . height ( ) ,
512
+ right : right ,
513
+ bottom : bottom ,
505
514
leftDiff : ui . originalOffset . left - ui . originalPosition . left ,
506
515
topDiff : ui . originalOffset . top - ui . originalPosition . top ,
507
516
width : this . dragDimensions . width ,
@@ -937,8 +946,8 @@ if ( $.uiBackCompat !== false ) {
937
946
$ . widget ( "ui.draggable" , $ . ui . draggable , {
938
947
options : {
939
948
scroll : true ,
940
- scrollSpeed : null ,
941
- scrollSensitivity : null
949
+ scrollSpeed : 20 ,
950
+ scrollSensitivity : 20
942
951
} ,
943
952
_create : function ( ) {
944
953
var self = this ,
0 commit comments