amend(collectionRepeat): make after container always calculate size correctly

Closes #2376.
This commit is contained in:
Andrew
2015-03-02 10:01:47 -07:00
parent 96e860134b
commit af7a03cd39
2 changed files with 4 additions and 4 deletions

View File

@@ -83,7 +83,7 @@ IonicModule
var ONE_PX_TRANSPARENT_IMG_SRC = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
var WIDTH_HEIGHT_REGEX = /height:.*?px;\s*width:.*?px/;
var DEFAULT_RENDER_BUFFER = 10;
var DEFAULT_RENDER_BUFFER = 2;
CollectionRepeatDirective.$inject = ['$ionicCollectionManager', '$parse', '$window', '$$rAF'];
function CollectionRepeatDirective($ionicCollectionManager, $parse, $window, $$rAF) {
@@ -454,8 +454,7 @@ function RepeatManagerFactory($rootScope, $window, $$rAF) {
// Create the pool of items for reuse, setting the size to (estimatedItemsOnScreen) * 2,
// plus the size of the renderBuffer.
if (!isLayoutReady) {
var poolSize = 2 * view.scrollPrimarySize /
view.estimatedPrimarySize * view.estimatedItemsAcross + (renderBuffer * 2);
var poolSize = Math.max(20, renderBuffer * 3);
for (var i = 0; i < poolSize; i++) {
itemsPool.push(new RepeatItem());
}

View File

@@ -279,7 +279,8 @@
}
.collection-repeat-after-container {
z-index: 0;
&.horizontal {
display: block;
&.vertical {
display: inline-block;
}
}