Fixed #172 - list item reorder persistence

This commit is contained in:
Max Lynch
2013-11-22 10:39:31 -06:00
parent a04dc02dee
commit 0d5bd759a1
7 changed files with 98 additions and 10 deletions

View File

@@ -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});
});
}
});