From 4065834658a875330837a41504d21566e6a15630 Mon Sep 17 00:00:00 2001 From: Drew Walters Date: Thu, 21 Jul 2011 00:25:57 +0800 Subject: [PATCH] Fixes #37. Move Acceleration object to global scope. --- javascript/accelerometer.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/javascript/accelerometer.js b/javascript/accelerometer.js index 629dc01..32bda70 100644 --- a/javascript/accelerometer.js +++ b/javascript/accelerometer.js @@ -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 * @@ -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