Browse files

Fixes #37. Move Acceleration object to global scope.

  • Loading branch information...
1 parent f1120a9 commit 4065834658a875330837a41504d21566e6a15630 @deedubbu deedubbu committed Jul 21, 2011
Showing with 10 additions and 10 deletions.
  1. +10 −10 javascript/accelerometer.js
View
20 javascript/accelerometer.js
@@ -8,6 +8,16 @@
*/
/**
+ * 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
*
* Provides access to device accelerometer data.
@@ -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

0 comments on commit 4065834

Please sign in to comment.