File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 186186 this . el = opts . el ;
187187 this . scrollEl = opts . scrollEl ;
188188 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+ }
189198 } ;
190199
191200 ReorderDrag . prototype = new DragOp ( ) ;
192201
193202 ReorderDrag . prototype . _moveElement = function ( e ) {
194203 var y = e . gesture . center . pageY +
195204 this . scrollView . getValues ( ) . top -
196- this . scrollView . __container . offsetTop -
197205 ( this . _currentDrag . elementHeight / 2 ) -
198- this . listEl . offsetTop ;
206+ this . listEl . trueTop ;
199207 this . el . style [ ionic . CSS . TRANSFORM ] = 'translate3d(0, ' + y + 'px, 0)' ;
200208 } ;
201209
231239
232240 var scrollY = 0 ;
233241 var pageY = e . gesture . center . pageY ;
234- var offset = this . listEl . offsetTop + this . scrollView . __container . offsetTop ;
242+ var offset = this . listEl . trueTop ;
235243
236244 //If we have a scrollView, check scroll boundaries for dragged element and scroll if necessary
237245 if ( this . scrollView ) {
You can’t perform that action at this time.
0 commit comments