@@ -56,10 +56,11 @@ return $.widget("ui.selectable", $.ui.mouse, {
56
56
selectees . addClass ( "ui-selectee" ) ;
57
57
selectees . each ( function ( ) {
58
58
var $this = $ ( this ) ,
59
+ w = $ ( window ) ,
59
60
context = $ ( that . options . appendTo ) ,
60
61
pos = $this . offset ( ) ;
61
- pos . top += context . scrollTop ( ) ;
62
- pos . left += context . scrollLeft ( ) ;
62
+ pos . left += context . scrollLeft ( ) - w . scrollLeft ( ) ;
63
+ pos . top += context . scrollTop ( ) - w . scrollTop ( ) ;
63
64
$ . data ( this , "selectable-item" , {
64
65
element : this ,
65
66
$element : $this ,
@@ -95,11 +96,12 @@ return $.widget("ui.selectable", $.ui.mouse, {
95
96
_mouseStart : function ( event ) {
96
97
var that = this ,
97
98
options = this . options ,
99
+ w = $ ( window ) ,
98
100
context = $ ( options . appendTo ) ,
99
- scrollLeft = context . scrollLeft ( ) ,
100
- scrollTop = context . scrollTop ( ) ;
101
+ x = event . pageX + context . scrollLeft ( ) - w . scrollLeft ( ) ,
102
+ y = event . pageY + context . scrollTop ( ) - w . scrollTop ( ) ;
101
103
102
- this . opos = [ scrollLeft + event . pageX , scrollTop + event . pageY ] ;
104
+ this . opos = [ x , y ] ;
103
105
104
106
if ( this . options . disabled ) {
105
107
return ;
@@ -112,8 +114,8 @@ return $.widget("ui.selectable", $.ui.mouse, {
112
114
$ ( options . appendTo ) . append ( this . helper ) ;
113
115
// position helper (lasso)
114
116
this . helper . css ( {
115
- "left" : scrollLeft + event . pageX ,
116
- "top" : scrollTop + event . pageY ,
117
+ "left" : x ,
118
+ "top" : y ,
117
119
"width" : 0 ,
118
120
"height" : 0
119
121
} ) ;
@@ -175,11 +177,12 @@ return $.widget("ui.selectable", $.ui.mouse, {
175
177
var tmp ,
176
178
that = this ,
177
179
options = this . options ,
180
+ w = $ ( window ) ,
178
181
context = $ ( options . appendTo ) ,
179
182
x1 = this . opos [ 0 ] ,
180
183
y1 = this . opos [ 1 ] ,
181
- x2 = event . pageX + context . scrollLeft ( ) ,
182
- y2 = event . pageY + context . scrollTop ( ) ;
184
+ x2 = event . pageX + context . scrollLeft ( ) - w . scrollLeft ( ) ,
185
+ y2 = event . pageY + context . scrollTop ( ) - w . scrollTop ( ) ;
183
186
184
187
if ( x1 > x2 ) { tmp = x2 ; x2 = x1 ; x1 = tmp ; }
185
188
if ( y1 > y2 ) { tmp = y2 ; y2 = y1 ; y1 = tmp ; }
0 commit comments