Skip to content

Commit

Permalink
Merge pull request #4 from clintonyeb/master
Browse files Browse the repository at this point in the history
Improved code readability
  • Loading branch information
hsnaydd authored Mar 22, 2017
2 parents 7024be8 + ce127e9 commit 57c06b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/moveTo.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ const MoveTo = (() => {
let currentPageYOffset = window.pageYOffset;

if (!startTime) {
// To starts time from 1, we subtracted -1 from current time
// To starts time from 1, we subtracted 1 from current time
// If time starts from 1 The first loop will not do anything,
// because easing value will be zero
startTime = currentTime - 1;
}

const timeElapsed = currentTime - startTime;

if (lastPageYOffset !== 0) {
if (lastPageYOffset) {
if (
(lastPageYOffset === currentPageYOffset) ||
(change > 0 && lastPageYOffset > currentPageYOffset) ||
Expand Down

0 comments on commit 57c06b5

Please sign in to comment.