diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index 33a6a2995d..63b510aeec 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -1005,6 +1005,7 @@ angular.module('ionic.ui.list', ['ngAnimate']) refreshComplete: '=', onSelect: '&', onDelete: '&', + onReorder: '&', optionButtons: '&', deleteIcon: '@', reorderIcon: '@' diff --git a/dist/js/ionic.js b/dist/js/ionic.js index 255777dd57..dd8d922400 100644 --- a/dist/js/ionic.js +++ b/dist/js/ionic.js @@ -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); diff --git a/js/ext/angular/src/directive/ionicList.js b/js/ext/angular/src/directive/ionicList.js index efabb83cd8..31ebccf6ad 100644 --- a/js/ext/angular/src/directive/ionicList.js +++ b/js/ext/angular/src/directive/ionicList.js @@ -207,6 +207,7 @@ angular.module('ionic.ui.list', ['ngAnimate']) refreshComplete: '=', onSelect: '&', onDelete: '&', + onReorder: '&', optionButtons: '&', deleteIcon: '@', reorderIcon: '@' diff --git a/js/views/listView.js b/js/views/listView.js index 6b09c389b0..8a0962a2fc 100644 --- a/js/views/listView.js +++ b/js/views/listView.js @@ -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);