Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #5 from joelmukuthu/greenkeeper/eslint-4.19.0
Browse files Browse the repository at this point in the history
Update eslint to the latest version 🚀
  • Loading branch information
joelmukuthu committed Mar 17, 2018
2 parents c49a541 + 797a8a1 commit 6b0702b
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 74 deletions.
72 changes: 36 additions & 36 deletions dist/angular-scrollie.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,49 +36,49 @@ angular.module('scrollie', []);
}

angular
.module('scrollie')
.factory('requestAnimation', [
'$timeout',
'$window',
function (
$timeout,
$window
) {
var lastTime,
requestAnimation = $window.requestAnimationFrame ||
.module('scrollie')
.factory('requestAnimation', [
'$timeout',
'$window',
function (
$timeout,
$window
) {
var lastTime,
requestAnimation = $window.requestAnimationFrame ||
getWithVendorPrefix('RequestAnimationFrame', $window);

if (!requestAnimation || iOS6($window)) { // iOS6 is buggy
requestAnimation = function (callback) {
var now = Date.now();
var nextTime = Math.max(lastTime + 16, now);
return $timeout(function () {
callback(lastTime = nextTime);
}, nextTime - now);
};
}
if (!requestAnimation || iOS6($window)) { // iOS6 is buggy
requestAnimation = function (callback) {
var now = Date.now();
var nextTime = Math.max(lastTime + 16, now);
return $timeout(function () {
callback(lastTime = nextTime);
}, nextTime - now);
};
}

return requestAnimation;
}
])
.factory('cancelAnimation', [
'$timeout',
'$window',
function (
$timeout,
$window
) {
var cancelAnimation = $window.cancelAnimationFrame ||
return requestAnimation;
}
])
.factory('cancelAnimation', [
'$timeout',
'$window',
function (
$timeout,
$window
) {
var cancelAnimation = $window.cancelAnimationFrame ||
getWithVendorPrefix('CancelAnimationFrame', $window) ||
getWithVendorPrefix('CancelRequestAnimationFrame', $window);

if (!cancelAnimation || iOS6($window)) { // iOS6 is buggy
cancelAnimation = $timeout.cancel;
}
if (!cancelAnimation || iOS6($window)) { // iOS6 is buggy
cancelAnimation = $timeout.cancel;
}

return cancelAnimation;
}
]);
return cancelAnimation;
}
]);
})();

// this is built upon http://stackoverflow.com/a/16136789/1004406
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"lint": "eslint .",
"test": "karma start test/karma.conf.js",
"build": "npm run lint && npm test && grunt build",
"prepublish": "npm run lint && npm test"
"prepublishOnly": "npm run lint && npm test"
},
"keywords": [
"angular",
Expand All @@ -18,7 +18,7 @@
"license": "MIT",
"devDependencies": {
"angular-mocks": "^1.2.24",
"eslint": "^3.2.0",
"eslint": "^4.19.0",
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "^1.0.1",
Expand Down
72 changes: 36 additions & 36 deletions src/services/requestAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,47 @@
}

angular
.module('scrollie')
.factory('requestAnimation', [
'$timeout',
'$window',
function (
$timeout,
$window
) {
var lastTime,
requestAnimation = $window.requestAnimationFrame ||
.module('scrollie')
.factory('requestAnimation', [
'$timeout',
'$window',
function (
$timeout,
$window
) {
var lastTime,
requestAnimation = $window.requestAnimationFrame ||
getWithVendorPrefix('RequestAnimationFrame', $window);

if (!requestAnimation || iOS6($window)) { // iOS6 is buggy
requestAnimation = function (callback) {
var now = Date.now();
var nextTime = Math.max(lastTime + 16, now);
return $timeout(function () {
callback(lastTime = nextTime);
}, nextTime - now);
};
}
if (!requestAnimation || iOS6($window)) { // iOS6 is buggy
requestAnimation = function (callback) {
var now = Date.now();
var nextTime = Math.max(lastTime + 16, now);
return $timeout(function () {
callback(lastTime = nextTime);
}, nextTime - now);
};
}

return requestAnimation;
}
])
.factory('cancelAnimation', [
'$timeout',
'$window',
function (
$timeout,
$window
) {
var cancelAnimation = $window.cancelAnimationFrame ||
return requestAnimation;
}
])
.factory('cancelAnimation', [
'$timeout',
'$window',
function (
$timeout,
$window
) {
var cancelAnimation = $window.cancelAnimationFrame ||
getWithVendorPrefix('CancelAnimationFrame', $window) ||
getWithVendorPrefix('CancelRequestAnimationFrame', $window);

if (!cancelAnimation || iOS6($window)) { // iOS6 is buggy
cancelAnimation = $timeout.cancel;
}
if (!cancelAnimation || iOS6($window)) { // iOS6 is buggy
cancelAnimation = $timeout.cancel;
}

return cancelAnimation;
}
]);
return cancelAnimation;
}
]);
})();

0 comments on commit 6b0702b

Please sign in to comment.