Skip to content

Commit 0af97e4

Browse files
committed
lower buffer spaces by 1
1 parent ae14f02 commit 0af97e4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

js/angular/service/collectionView.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ IonicModule
44
'$rootScope',
55
'$timeout',
66
function($rootScope, $timeout) {
7-
var BUFFER_SPACES = 2;
7+
var BUFFER_SPACES = 1;
88
function CollectionView(options) {
99
this.dataSource = options.dataSource;
1010
this.element = options.element;
@@ -88,7 +88,7 @@ function($rootScope, $timeout) {
8888
render: function(shouldRedrawAll) {
8989
var i;
9090
var itemsPerSpace = this.getItemsPerSpace();
91-
var viewportSpaces = Math.floor(this.getScrollSize() / this.itemSizePrimary);
91+
var viewportSpaces = Math.ceil(this.getScrollSize() / this.itemSizePrimary);
9292
var viewportStartIndex = Math.ceil(this.getScrollValue() / this.itemSizePrimary) *
9393
itemsPerSpace;
9494
var viewportEndIndex = viewportStartIndex + (viewportSpaces * itemsPerSpace);
@@ -142,10 +142,6 @@ function($rootScope, $timeout) {
142142
this.lastRenderScrollValue = Math.ceil(this.bufferStartIndex / itemsPerSpace) *
143143
this.itemSizePrimary;
144144

145-
console.log('render(). viewportStartIndex =', viewportStartIndex,
146-
'bufferTransformOffset =', this.bufferTransformOffset,
147-
'scrollValue ', this.lastRenderScrollValue);
148-
149145
if (!this.dataSource.scope.$$phase) {
150146
this.dataSource.scope.$digest();
151147
}

0 commit comments

Comments
 (0)