Fixed reordering for #319

This commit is contained in:
Max Lynch
2013-12-12 12:23:33 -06:00
committed by Adam Bradley
parent d9eb0440e6
commit ecbafa4bb6
4 changed files with 26 additions and 30 deletions

View File

@@ -1005,6 +1005,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
refreshComplete: '=',
onSelect: '&',
onDelete: '&',
onReorder: '&',
optionButtons: '&',
deleteIcon: '@',
reorderIcon: '@'

27
dist/js/ionic.js vendored
View File

@@ -4483,9 +4483,12 @@ ionic.views.Scroll = ionic.views.View.inherit({
}, this.el);
window.ionic.onGesture('release', function(e) {
_this._handleTouchRelease(e);
_this._handleEndDrag(e);
}, this.el);
window.ionic.onGesture('drag', function(e) {
_this._handleDrag(e);
}, this.el);
// Start the drag states
this._initDrag();
},
@@ -4618,6 +4621,13 @@ ionic.views.Scroll = ionic.views.View.inherit({
return;
}
// Cancel touch timeout
clearTimeout(this._touchTimeout);
var items = _this.el.querySelectorAll('.item');
for(var i = 0, l = items.length; i < l; i++) {
items[i].classList.remove('active');
}
this._dragOp.end(e, function() {
_this._initDrag();
});
@@ -4648,7 +4658,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
return;
}
e.preventDefault();
e.gesture.srcEvent.preventDefault();
this._dragOp.drag(e);
},
@@ -4670,19 +4680,6 @@ ionic.views.Scroll = ionic.views.View.inherit({
}, 250);
},
/**
* Handle the release event to remove the active state on an item if necessary.
*/
_handleTouchRelease: function(e) {
var _this = this;
// Cancel touch timeout
clearTimeout(this._touchTimeout);
var items = _this.el.querySelectorAll('.item');
for(var i = 0, l = items.length; i < l; i++) {
items[i].classList.remove('active');
}
}
});
})(ionic);

View File

@@ -207,6 +207,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
refreshComplete: '=',
onSelect: '&',
onDelete: '&',
onReorder: '&',
optionButtons: '&',
deleteIcon: '@',
reorderIcon: '@'

View File

@@ -285,9 +285,12 @@
}, this.el);
window.ionic.onGesture('release', function(e) {
_this._handleTouchRelease(e);
_this._handleEndDrag(e);
}, this.el);
window.ionic.onGesture('drag', function(e) {
_this._handleDrag(e);
}, this.el);
// Start the drag states
this._initDrag();
},
@@ -420,6 +423,13 @@
return;
}
// Cancel touch timeout
clearTimeout(this._touchTimeout);
var items = _this.el.querySelectorAll('.item');
for(var i = 0, l = items.length; i < l; i++) {
items[i].classList.remove('active');
}
this._dragOp.end(e, function() {
_this._initDrag();
});
@@ -450,7 +460,7 @@
return;
}
e.preventDefault();
e.gesture.srcEvent.preventDefault();
this._dragOp.drag(e);
},
@@ -472,19 +482,6 @@
}, 250);
},
/**
* Handle the release event to remove the active state on an item if necessary.
*/
_handleTouchRelease: function(e) {
var _this = this;
// Cancel touch timeout
clearTimeout(this._touchTimeout);
var items = _this.el.querySelectorAll('.item');
for(var i = 0, l = items.length; i < l; i++) {
items[i].classList.remove('active');
}
}
});
})(ionic);