From af7a03cd3944be334f39c7bec8f1e2396093ef03 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 2 Mar 2015 10:01:47 -0700 Subject: [PATCH] amend(collectionRepeat): make after container always calculate size correctly Closes #2376. --- js/angular/directive/collectionRepeat.js | 5 ++--- scss/_util.scss | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/angular/directive/collectionRepeat.js b/js/angular/directive/collectionRepeat.js index 7ff5cdeb83..18f26e7b4d 100644 --- a/js/angular/directive/collectionRepeat.js +++ b/js/angular/directive/collectionRepeat.js @@ -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()); } diff --git a/scss/_util.scss b/scss/_util.scss index eb85c0d626..fa27363b8d 100644 --- a/scss/_util.scss +++ b/scss/_util.scss @@ -279,7 +279,8 @@ } .collection-repeat-after-container { z-index: 0; - &.horizontal { + display: block; + &.vertical { display: inline-block; } }