Skip to content

Commit

Permalink
Fixes #37. Move Acceleration object to global scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Walters committed Jul 20, 2011
1 parent f1120a9 commit 4065834
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions javascript/accelerometer.js
Expand Up @@ -7,6 +7,16 @@
* Copyright (c) 2010-2011, IBM Corporation
*/

/**
* Acceleration object has 3D coordinates and timestamp.
*/
var Acceleration = function(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
this.timestamp = new Date().getTime();
};

/**
* navigator.accelerometer
*
Expand All @@ -19,16 +29,6 @@
if (typeof navigator.accelerometer !== "undefined") {
return;
}

/**
* Acceleration object has 3D coordinates and timestamp.
*/
function Acceleration(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
this.timestamp = new Date().getTime();
};

/**
* @constructor
Expand Down

0 comments on commit 4065834

Please sign in to comment.