Skip to content

Commit

Permalink
fix(ionList): make reorder follow an offset list as it scrolls
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Apr 29, 2014
1 parent 3e5b39f commit 3a68a2c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions js/views/listView.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
ReorderDrag.prototype._moveElement = function(e) {
var y = e.gesture.center.pageY -
this._currentDrag.elementHeight +
this._currentDrag.scrollDelta -
this.scrollView.getValues().top -
this.listEl.offsetTop;
this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(0, '+y+'px, 0)';
};
Expand All @@ -215,8 +215,7 @@
startIndex: startIndex,
placeholder: placeholder,
scrollHeight: scroll,
list: placeholder.parentNode,
scrollDelta: 0
list: placeholder.parentNode
};

this._moveElement(e);
Expand All @@ -243,12 +242,10 @@

if (e.gesture.deltaY < 0 && pixelsPastTop > 0 && scrollY > 0) {
this.scrollView.scrollBy(null, -pixelsPastTop);
this._currentDrag.scrollDelta -= pixelsPastTop;
}
if (e.gesture.deltaY > 0 && pixelsPastBottom > 0) {
if (scrollY < this.scrollView.getScrollMax().top) {
this.scrollView.scrollBy(null, pixelsPastBottom);
this._currentDrag.scrollDelta += pixelsPastBottom;
}
}
}
Expand Down

0 comments on commit 3a68a2c

Please sign in to comment.