File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 186
186
this . el = opts . el ;
187
187
this . scrollEl = opts . scrollEl ;
188
188
this . scrollView = opts . scrollView ;
189
+ // Get the True Top of the list el http://www.quirksmode.org/js/findpos.html
190
+ this . listEl . trueTop = 0 ;
191
+ if ( this . listEl . offsetParent ) {
192
+ var obj = this . listEl ;
193
+ do {
194
+ this . listEl . trueTop += obj . offsetTop ;
195
+ obj = obj . offsetParent ;
196
+ } while ( obj ) ;
197
+ }
189
198
} ;
190
199
191
200
ReorderDrag . prototype = new DragOp ( ) ;
192
201
193
202
ReorderDrag . prototype . _moveElement = function ( e ) {
194
203
var y = e . gesture . center . pageY +
195
204
this . scrollView . getValues ( ) . top -
196
- this . scrollView . __container . offsetTop -
197
205
( this . _currentDrag . elementHeight / 2 ) -
198
- this . listEl . offsetTop ;
206
+ this . listEl . trueTop ;
199
207
this . el . style [ ionic . CSS . TRANSFORM ] = 'translate3d(0, ' + y + 'px, 0)' ;
200
208
} ;
201
209
231
239
232
240
var scrollY = 0 ;
233
241
var pageY = e . gesture . center . pageY ;
234
- var offset = this . listEl . offsetTop + this . scrollView . __container . offsetTop ;
242
+ var offset = this . listEl . trueTop ;
235
243
236
244
//If we have a scrollView, check scroll boundaries for dragged element and scroll if necessary
237
245
if ( this . scrollView ) {
You can’t perform that action at this time.
0 commit comments