mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
collectionRepeat: rerender on resize
This commit is contained in:
11
js/angular/directive/collectionRepeat.js
vendored
11
js/angular/directive/collectionRepeat.js
vendored
@@ -58,13 +58,18 @@ function($collectionRepeatManager, $collectionRepeatDataSource, $parse) {
|
||||
if (value && !angular.isArray(value)) {
|
||||
throw new Error("collection-repeat expects an array to repeat over, but instead got '" + typeof value + "'.");
|
||||
}
|
||||
rerender(value);
|
||||
});
|
||||
|
||||
function rerender(value) {
|
||||
scrollView.resize();
|
||||
dataSource.setData(value);
|
||||
collectionRepeatManager.resize();
|
||||
});
|
||||
|
||||
}
|
||||
var resize = angular.bind(collectionRepeatManager, collectionRepeatManager.resize);
|
||||
ionic.on('resize', resize, window);
|
||||
ionic.on('resize', function() {
|
||||
rerender($scope.$eval(dataSource.listExpr));
|
||||
}, window);
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
collectionRepeatManager.destroy();
|
||||
|
||||
Reference in New Issue
Block a user