You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by he...@apache.org on 2012/11/06 00:00:30 UTC

[2/2] js commit: Update lib/webos/plugin/webos/compass.js

Update lib/webos/plugin/webos/compass.js

reverting code cleanup that broke functionality (Uncaught TypeError: Cannot read property 'magn
eticHeading' of undefined)


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/e7392475
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/e7392475
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/e7392475

Branch: refs/heads/master
Commit: e7392475eaf469280ae61126424adf57842ee440
Parents: a637188
Author: ghtomcat <ml...@yahoo.com>
Authored: Tue Oct 30 10:18:14 2012 +0100
Committer: hermwong <he...@gmail.com>
Committed: Mon Nov 5 14:33:10 2012 -0800

----------------------------------------------------------------------
 lib/webos/plugin/webos/compass.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/e7392475/lib/webos/plugin/webos/compass.js
----------------------------------------------------------------------
diff --git a/lib/webos/plugin/webos/compass.js b/lib/webos/plugin/webos/compass.js
index 96a9978..c6f392d 100644
--- a/lib/webos/plugin/webos/compass.js
+++ b/lib/webos/plugin/webos/compass.js
@@ -30,8 +30,9 @@ module.exports = {
         } else {
             console.error("webos plugin compass getheading");
             var onReadingChanged = function (e) {
+                var heading = new CompassHeading(e.magHeading, e.trueHeading);
                 document.removeEventListener("compass", onReadingChanged);
-                win(CompassHeading(e.magHeading, e.trueHeading));
+                win(heading);
             };
             document.addEventListener("compass", onReadingChanged);
         }