Permalink
Browse files

Fix premature animate end

  • Loading branch information...
1 parent 190948f commit 3fe52297513a59eef399c1f4cbaa35eb534f8cc0 @antonj committed Dec 9, 2013
Showing with 9 additions and 7 deletions.
  1. +4 −3 dist/viewpager.js
  2. +1 −1 dist/viewpager.min.js
  3. +4 −3 src/viewpager.js
View
@@ -282,9 +282,10 @@ function ViewPager(elem, options) {
}
if (is_animating &&
- ((should_change_page && (move_offset > Math.min(anim_from_offset, anim_to_offset) && move_offset < Math.max(anim_from_offset, anim_to_offset))) ||
- (!should_change_page && ((anim_from_offset >= 0 && move_offset > 0) ||
- (anim_from_offset <= 0 && move_offset < 0))))) {
+ ((should_change_page &&
+ (move_offset >= Math.min(anim_from_offset, anim_to_offset) &&
+ move_offset <= Math.max(anim_from_offset, anim_to_offset))) ||
+ (!should_change_page && move_offset !== 0))) {
onPageScroll(move_offset, active_page);
raf(update);
} else {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -200,9 +200,10 @@ function ViewPager(elem, options) {
}
if (is_animating &&
- ((should_change_page && (move_offset > Math.min(anim_from_offset, anim_to_offset) && move_offset < Math.max(anim_from_offset, anim_to_offset))) ||
- (!should_change_page && ((anim_from_offset >= 0 && move_offset > 0) ||
- (anim_from_offset <= 0 && move_offset < 0))))) {
+ ((should_change_page &&
+ (move_offset >= Math.min(anim_from_offset, anim_to_offset) &&
+ move_offset <= Math.max(anim_from_offset, anim_to_offset))) ||
+ (!should_change_page && move_offset !== 0))) {
onPageScroll(move_offset, active_page);
raf(update);
} else {

0 comments on commit 3fe5229

Please sign in to comment.