Permalink
Browse files

Made compass options optional as per Cordova API

  • Loading branch information...
jxp committed Oct 8, 2012
1 parent e937ac7 commit fc68d333b5b04e98b9c43ca6e80b1e37aceb2ffa
Showing with 2 additions and 2 deletions.
  1. +2 −2 js/phonegap-desktop.js
View
@@ -542,13 +542,13 @@ navigator.compass = {
}
},
watchHeading : function(compassSuccess, compassError, compassOptions) {
- return phonegapdesktop.internal.intervalFunction(compassSuccess, compassError, compassOptions.frequency, "compass", "heading", "error");
+ return phonegapdesktop.internal.intervalFunction(compassSuccess, compassError, (compassOptions !== undefined && compassOptions.frequency !== undefined) ? compassOptions.frequency : 100, "compass", "heading", "error");
},
clearWatch : function(watchID) {
phonegapdesktop.internal.cancelIntervalFunction(watchID);
},
watchHeadingFilter : function(compassSuccess, compassError, compassOptions) {
- return phonegapdesktop.internal.intervalFunction(compassSuccess, compassError, compassOptions.frequency || 5000, "compass", "heading", "error");
+ return phonegapdesktop.internal.intervalFunction(compassSuccess, compassError, (compassOptions !== undefined && compassOptions.frequency !== undefined) ? compassOptions.frequency : 100 || 5000, "compass", "heading", "error");
},
clearWatchFilter : function(watchID) {
phonegapdesktop.internal.cancelIntervalFunction(watchID);

0 comments on commit fc68d33

Please sign in to comment.