You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by js...@apache.org on 2014/11/12 18:41:22 UTC
cordova-plugin-device-motion git commit: CB-7977 Mention deviceready
in plugin docs
Repository: cordova-plugin-device-motion
Updated Branches:
refs/heads/master 59efd9eca -> 2eab1bb8b
CB-7977 Mention deviceready in plugin docs
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/2eab1bb8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/2eab1bb8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/2eab1bb8
Branch: refs/heads/master
Commit: 2eab1bb8b9d887fc024e79d5a6668051f692f56a
Parents: 59efd9e
Author: Josh Soref <js...@blackberry.com>
Authored: Thu Nov 6 17:09:28 2014 -0500
Committer: Josh Soref <js...@blackberry.com>
Committed: Thu Nov 6 17:09:28 2014 -0500
----------------------------------------------------------------------
doc/index.md | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/2eab1bb8/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index c76a0b5..49c23f9 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -24,6 +24,15 @@ a motion sensor that detects the change (_delta_) in movement relative to the
current device orientation, in three dimensions along the _x_, _y_, and _z_
axis.
+Access is via a global `navigator.accelerometer` object.
+
+Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(navigator.accelerometer);
+ }
+
## Installation
cordova plugin add org.apache.cordova.device-motion
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org