mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
amend(collectionRepeat): if data.length is 0, refresh data
This commit is contained in:
14
js/angular/directive/collectionRepeat.js
vendored
14
js/angular/directive/collectionRepeat.js
vendored
@@ -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))
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user