From 08b330e8bed7ef28067d306acb13179adff3b148 Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Thu, 24 Apr 2014 08:59:20 -0600 Subject: [PATCH] collectionRepeat: rerender on resize --- js/angular/directive/collectionRepeat.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/angular/directive/collectionRepeat.js b/js/angular/directive/collectionRepeat.js index 4cfcbf863b..bb9c2e8310 100644 --- a/js/angular/directive/collectionRepeat.js +++ b/js/angular/directive/collectionRepeat.js @@ -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();