Skip to content

Commit

Permalink
fix(collectionRepeat): Properly calcuate list height and show ion-inf…
Browse files Browse the repository at this point in the history
…inite-scroll. Fixes #2376
  • Loading branch information
perrygovier committed Jan 19, 2015
1 parent 6a2be56 commit 8389968
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions js/angular/directive/collectionRepeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions js/angular/service/collectionRepeatManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
/*
Expand Down
5 changes: 3 additions & 2 deletions test/unit/angular/service/collectionRepeatManager.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -265,14 +265,15 @@ 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
}],
beforeSize: 0,
totalSize: 130
});
manager.resize();
expect(manager.dataSource.transcludeParent[0].style.height).toBe('130px');
expect(manager.viewportSize).toBe(130);
});
});
Expand Down

0 comments on commit 8389968

Please sign in to comment.