fix(collectionRepeat): Properly calcuate list height and show ion-infinite-scroll. Fixes #2376

This commit is contained in:
perry
2015-01-19 17:24:53 -06:00
parent 6a2be56b4b
commit 838996815c
3 changed files with 5 additions and 2 deletions

View File

@@ -228,6 +228,7 @@ function($collectionRepeatManager, $collectionDataSource, $parse) {
before = false;
} else {
if (node.hasAttribute('collection-repeat-ignore')) return;
if (node.nodeName === 'ION-INFINITE-SCROLL')return;
var width = node.offsetWidth;
var height = node.offsetHeight;
if (width && height) {

View File

@@ -154,6 +154,7 @@ function($rootScope, $timeout) {
this.beforeSize = result.beforeSize;
this.setCurrentIndex(0);
this.render(true);
this.dataSource.transcludeParent[0].style.height = result.totalSize + "px";
this.dataSource.setup();
},
/*

View File

@@ -251,7 +251,7 @@ describe('collectionRepeatManager service', function() {
it('should work without data', function() {
var manager = setup();
spyOn(manager, 'render');
spyOn(manager, 'calculateDimensions').andReturn({
spyOn(manager, 'calculateDimensions').andReturn({
dimensions: [],
beforeSize: 0,
totalSize: 0
@@ -265,7 +265,7 @@ describe('collectionRepeatManager service', function() {
});
it('should work with data', function() {
var manager = setup();
spyOn(manager, 'calculateDimensions').andReturn({
spyOn(manager, 'calculateDimensions').andReturn({
dimensions: [{
primaryPos: 100, primarySize: 30
}],
@@ -273,6 +273,7 @@ describe('collectionRepeatManager service', function() {
totalSize: 130
});
manager.resize();
expect(manager.dataSource.transcludeParent[0].style.height).toBe('130px');
expect(manager.viewportSize).toBe(130);
});
});