mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Fixed #172 - list item reorder persistence
This commit is contained in:
7
js/ext/angular/src/directive/ionicList.js
vendored
7
js/ext/angular/src/directive/ionicList.js
vendored
@@ -163,6 +163,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
hasPullToRefresh: '@',
|
||||
onRefresh: '&',
|
||||
onRefreshOpening: '&',
|
||||
onReorder: '&',
|
||||
refreshComplete: '='
|
||||
},
|
||||
|
||||
@@ -191,6 +192,12 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
onRefreshOpening: function(amt) {
|
||||
$scope.onRefreshOpening({amount: amt});
|
||||
$scope.$parent.$broadcast('scroll.onRefreshOpening', amt);
|
||||
},
|
||||
onReorder: function(el, oldIndex, newIndex) {
|
||||
console.log('Moved', el,oldIndex,newIndex);
|
||||
$scope.$apply(function() {
|
||||
$scope.onReorder({el: el, start: oldIndex, end: newIndex});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user