Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hsnaydd committed Mar 24, 2017
2 parents 57c06b5 + 696e470 commit 8d94847
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "moveto",
"description": "A lightweight scroll animation javascript library without any dependency.",
"main": "src/moveTo.js",
"main": "dist/moveTo.js",
"authors": [
"Hasan Aydoğdu <hsnaydd@gmail.com>"
],
Expand Down
10 changes: 5 additions & 5 deletions dist/moveTo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* MoveTo - A lightweight scroll animation javascript library without any dependency.
* Version 1.5.2 (22-03-2017 10:25)
* Version 1.5.3 (24-03-2017 14:41)
* Licensed under MIT
* Copyright 2017 Hasan Aydoğdu <hsnaydd@gmail.com>
*/
Expand Down Expand Up @@ -135,22 +135,22 @@ var MoveTo = function () {
to -= options.tolerance;
var change = to - from;
var startTime = null;
var lastPageYOffset = 0;
var lastPageYOffset = void 0;

// rAF loop
var loop = function loop(currentTime) {
var 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;
}

var timeElapsed = currentTime - startTime;

if (lastPageYOffset !== 0) {
if (lastPageYOffset) {
if (
lastPageYOffset === currentPageYOffset ||
change > 0 && lastPageYOffset > currentPageYOffset ||
Expand Down Expand Up @@ -211,5 +211,5 @@ var MoveTo = function () {
if (typeof module !== 'undefined') {
module.exports = MoveTo;
} else {
window.moveTo = MoveTo;
window.MoveTo = MoveTo;
}
4 changes: 2 additions & 2 deletions dist/moveTo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "moveto",
"version": "1.5.2",
"version": "1.5.3",
"description": "A lightweight scroll animation javascript library without any dependency.",
"main": "src/moveTo.js",
"main": "dist/moveTo.js",
"scripts": {
"test": "ava tests/**"
},
Expand Down
4 changes: 2 additions & 2 deletions src/moveTo.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const MoveTo = (() => {
to -= options.tolerance;
const change = to - from;
let startTime = null;
let lastPageYOffset = 0;
let lastPageYOffset;

// rAF loop
const loop = (currentTime) => {
Expand Down Expand Up @@ -204,5 +204,5 @@ const MoveTo = (() => {
if (typeof module !== 'undefined') {
module.exports = MoveTo;
} else {
window.moveTo = MoveTo;
window.MoveTo = MoveTo;
}

0 comments on commit 8d94847

Please sign in to comment.