cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alsoro...@apache.org
Subject cordova-plugin-device-motion git commit: CB-13115 (browser) Fixed getCurrentAcceleration() on Firefox, Safari and Edge
Date Wed, 26 Jul 2017 10:20:44 GMT
Repository: cordova-plugin-device-motion
Updated Branches:
  refs/heads/master 756d0db28 -> c9642ff2a


CB-13115 (browser) Fixed getCurrentAcceleration() on Firefox, Safari and Edge


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/c9642ff2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/c9642ff2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/c9642ff2

Branch: refs/heads/master
Commit: c9642ff2a1a02a079a264e9ec4fe83ce2a126e77
Parents: 756d0db
Author: Alexander Sorokin <alexander.sorokin@akvelon.com>
Authored: Wed Jul 26 13:06:40 2017 +0300
Committer: Alexander Sorokin <alexander.sorokin@akvelon.com>
Committed: Wed Jul 26 13:06:40 2017 +0300

----------------------------------------------------------------------
 www/accelerometer.js | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/c9642ff2/www/accelerometer.js
----------------------------------------------------------------------
diff --git a/www/accelerometer.js b/www/accelerometer.js
index 21abe8b..40d320a 100644
--- a/www/accelerometer.js
+++ b/www/accelerometer.js
@@ -105,6 +105,14 @@ var accelerometer = {
             return;
         }
 
+        if (cordova.platformId === "browser" && !eventTimerId) {
+            // fire devicemotion event once
+            var devicemotionEvent = new Event('devicemotion');
+            window.setTimeout(function() {
+                window.dispatchEvent(devicemotionEvent);
+            }, 200);
+        }
+
         var p;
         var win = function (a) {
             removeListeners(p);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message