diff --git a/js/angular/service/collectionRepeatDataSource.js b/js/angular/service/collectionRepeatDataSource.js index 357251bb24f..181b0731912 100644 --- a/js/angular/service/collectionRepeatDataSource.js +++ b/js/angular/service/collectionRepeatDataSource.js @@ -61,7 +61,6 @@ function($cacheFactory, $parse, $rootScope) { item.scope = this.scope.$new(); this.transcludeFn(item.scope, function(clone) { - clone.css('position', 'absolute'); item.element = clone; }); this.transcludeParent.append(item.element); diff --git a/js/angular/service/collectionRepeatManager.js b/js/angular/service/collectionRepeatManager.js index 6b3e64484d8..f8f61b8249f 100644 --- a/js/angular/service/collectionRepeatManager.js +++ b/js/angular/service/collectionRepeatManager.js @@ -310,15 +310,25 @@ function($rootScope, $timeout) { renderItem: function(dataIndex, primaryPos, secondaryPos) { // Attach an item, and set its transform position to the required value var item = this.dataSource.attachItemAtIndex(dataIndex); + var itemDimensions = this.dimensions[dataIndex]; //console.log(dataIndex, item); if (item && item.element) { if (item.primaryPos !== primaryPos || item.secondaryPos !== secondaryPos) { - item.element.css(ionic.CSS.TRANSFORM, this.transformString( + item.element[0].style[ionic.CSS.TRANSFORM] = this.transformString( primaryPos, secondaryPos - )); + ); item.primaryPos = primaryPos; item.secondaryPos = secondaryPos; } + + var width = this.isVertical ? itemDimensions.secondarySize : itemDimensions.primarySize; + var height = this.isVertical ? itemDimensions.primarySize : itemDimensions.secondarySize; + if (item.cssWidth !== width) { + item.element[0].style.width = (item.cssWidth = width) + 'px'; + } + if (item.cssHeight !== height) { + item.element[0].style.height = (item.cssHeight = height) + 'px'; + } // Save the item in rendered items this.renderedItems[dataIndex] = item; } else { diff --git a/scss/_util.scss b/scss/_util.scss index 6316d28f79d..30b17fdcd4a 100644 --- a/scss/_util.scss +++ b/scss/_util.scss @@ -248,3 +248,9 @@ .dark-border { border-color: $button-dark-border; } + +[collection-repeat] { + /* Position is set by transforms */ + left: 0 !important; + position: absolute !important; +} diff --git a/test/html/list-fit.html b/test/html/list-fit.html index ab1e20a8cc0..421298875b2 100644 --- a/test/html/list-fit.html +++ b/test/html/list-fit.html @@ -31,9 +31,7 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis porttitor diam urna, vitae consectetur lectus aliquet quis.