Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed JSHints

  • Loading branch information...
commit 4f2ec1a7571b3bf920cc1236bd7028367ef2afd8 1 parent 9ed8061
@timsuchanek timsuchanek authored
Showing with 10 additions and 11 deletions.
  1. +4 −5 test/drift-canvas/js/app.js
  2. +6 −6 test/modules/drift-move.js
View
9 test/drift-canvas/js/app.js
@@ -23,15 +23,14 @@ window.onload = function (e) {
ctx.fill();
}
-
var options = {
startCoordinates: { //optional
x: shape.x,
y: shape.y
},
- degree: 180, // 90 means move right
- distance: 300, // speed in pixels per second
- duration: .5, // duration of drift in seconds
+ degree: 90, // 90 means move right
+ distance: 50, // speed in pixels per second
+ duration: 0.02, // duration of drift in seconds
start: function (x,y) {
drawCircle(x, y);
}, // Callback for start, arguments x,y
@@ -47,4 +46,4 @@ window.onload = function (e) {
//start drifting
drift(options);
-}
+};
View
12 test/modules/drift-move.js
@@ -34,10 +34,10 @@ function drift (options, window) {
// if no start point was given, start at 0
if (options.hasOwnProperty('startCoordinates')) {
- if (options.startCoordinates.hasOwnProperty('x')
- && options.startCoordinates.hasOwnProperty('y')
- && typeof options.startCoordinates.x === 'number'
- && typeof options.startCoordinates.y === 'number') {
+ if (options.startCoordinates.hasOwnProperty('x') &&
+ options.startCoordinates.hasOwnProperty('y') &&
+ typeof options.startCoordinates.x === 'number' &&
+ typeof options.startCoordinates.y === 'number') {
x = options.startCoordinates.x;
y = options.startCoordinates.y;
} else {
@@ -53,8 +53,8 @@ function drift (options, window) {
stepY = stepY * moveCoeficent;
//start
- if (options.hasOwnProperty('start')
- && typeof options.start === 'function') {
+ if (options.hasOwnProperty('start') &&
+ typeof options.start === 'function') {
//call start callback
options.start(x, y);
}
Please sign in to comment.
Something went wrong with that request. Please try again.