List item reordering!

This commit is contained in:
Max Lynch
2013-10-14 12:05:25 -05:00
parent c6d33bfb72
commit 38b8c6e4b1
2 changed files with 10 additions and 18 deletions

14
dist/js/ionic.js vendored
View File

@ -1990,7 +1990,7 @@ window.ionic = {
// Grab the starting Y point for the item
var offsetY = this.el.style.top;//parseFloat(this.el.style.webkitTransform.replace('translate3d(', '').split(',')[1]) || 0;
var offsetY = this.el.offsetTop;//parseFloat(this.el.style.webkitTransform.replace('translate3d(', '').split(',')[1]) || 0;
var placeholder = this.el.cloneNode(true);
@ -2002,8 +2002,7 @@ window.ionic = {
this._currentDrag = {
startOffsetY: offsetY,
startOffsetTop: this.el.offsetTop,
startOffsetTop: offsetY,
placeholder: placeholder
};
};
@ -2019,18 +2018,15 @@ window.ionic = {
// Check if we should start dragging. Check if we've dragged past the threshold,
// or we are starting from the open state.
if(!_this._isDragging &&
((Math.abs(e.gesture.deltaY) > _this.dragThresholdY) ||
(Math.abs(_this._currentDrag.startOffsetY) > 0)))
{
if(!_this._isDragging && Math.abs(e.gesture.deltaY) > _this.dragThresholdY) {
_this._isDragging = true;
}
if(_this._isDragging) {
var newY = _this._currentDrag.startOffsetTop + e.gesture.deltaY; //Math.min(0, _this._currentDrag.startOffsetY + e.gesture.deltaY);
var newY = _this._currentDrag.startOffsetTop + e.gesture.deltaY;
console.log(newY);
_this.el.style.top = newY + 'px';//webkitTransform = 'translate3d(0, ' + newY + 'px, 0)';
_this.el.style.top = newY + 'px';
_this._currentDrag.currentY = newY;