Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Fixed rare bug where ScrollController.ensureVisible didn't always scr…
Browse files Browse the repository at this point in the history
…oll the item into view (physics-engine remained a sleep)
  • Loading branch information
IjzerenHein committed Oct 8, 2015
1 parent 254b970 commit 9dca230
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ScrollController.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ define(function(require, exports, module) {
this._scroll.particleValue = position;
this._scroll.particle.setPosition1D(position);
//_log.call(this, 'setParticle.position: ', position, ' (old: ', oldPosition, ', delta: ', position - oldPosition, ', phase: ', phase, ')');
if (this._scroll.springValue !== undefined) {
this._scroll.pe.wake();
}
}
if (velocity !== undefined) {
var oldVelocity = this._scroll.particle.getVelocity1D();
Expand Down Expand Up @@ -907,7 +910,6 @@ define(function(require, exports, module) {
if (this._scroll.scrollToDirection) {
this._scroll.springPosition = scrollOffset - size[this._direction];
this._scroll.springSource = SpringSource.GOTONEXTDIRECTION;

}
else {
this._scroll.springPosition = scrollOffset + size[this._direction];
Expand Down Expand Up @@ -1772,7 +1774,7 @@ define(function(require, exports, module) {
this._postLayout(size, scrollOffset);
}

if (this.options.paginationMode === PaginationMode.PAGE) {
/*if (this.options.paginationMode === PaginationMode.PAGE) {
var node = this._nodes._first;
while (node) {
if (!node._invalidated && !node._removing) {
Expand All @@ -1783,7 +1785,7 @@ define(function(require, exports, module) {
if (this._nodes._contextState.addCount) {
console.log('adding nodes: ' + this._nodes._contextState.addCount);
}
}
}*/

// Mark non-invalidated nodes for removal
this._nodes.removeNonInvalidatedNodes(this.options.flowOptions.removeSpec);
Expand Down

0 comments on commit 9dca230

Please sign in to comment.