amend(collectionRepeat): if data.length is 0, refresh data

This commit is contained in:
Andrew
2015-03-04 15:29:46 -07:00
parent f6566726a5
commit cd5a5ead57

View File

@@ -223,13 +223,13 @@ function CollectionRepeatDirective($ionicCollectionManager, $parse, $window, $$r
"but got a " + typeof value);
}
if (newValue.length) {
// Wait for this digest to end before refreshing everything.
$timeout(function() {
getRepeatManager().refreshData(newValue);
// Wait for this digest to end before refreshing everything.
$timeout(function() {
if (newValue.length) {
refreshDimensions();
}, 0, false);
}
}
getRepeatManager().refreshData(newValue);
}, 0, false);
});
// Make sure this resize actually changed the size of the screen
@@ -579,7 +579,7 @@ function RepeatManagerFactory($rootScope, $window, $$rAF) {
if (item.secondarySize !== dim.secondarySize || item.primarySize !== dim.primarySize) {
item.node.style.cssText = item.node.style.cssText
.replace(WIDTH_HEIGHT_REGEX, WIDTH_HEIGHT_TEMPLATE_STR
.replace(PRIMARY, 1 + (item.primarySize = dim.primarySize))
.replace(PRIMARY, (item.primarySize = dim.primarySize) + 1)
.replace(SECONDARY, (item.secondarySize = dim.secondarySize))
);
}