]> git.openstreetmap.org Git - rails.git/commitdiff
Don't wait for a timeout when the browser doesn't support geolocation
authorTom Hughes <tom@compton.nu>
Sun, 24 Nov 2013 16:45:45 +0000 (16:45 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 24 Nov 2013 16:46:58 +0000 (16:46 +0000)
If the browser doesn't support geolocation then we might as well just
start manual edit mode straight away rather than waiting four seconds.

app/assets/javascripts/welcome.js

index 88b153af2e44e784f7faa65c0285381a882bdb83..aa28e99e9d87f39748254951f99828e67242363a 100644 (file)
@@ -29,12 +29,14 @@ $(document).ready(function() {
       e.preventDefault();
       $('.start-mapping').addClass('loading');
 
-      // handle firefox's weird implementation
-      // https://bugzilla.mozilla.org/show_bug.cgi?id=675533
-      window.setTimeout(manualEdit, 4000);
-
       if (navigator.geolocation) {
+        // handle firefox's weird implementation
+        // https://bugzilla.mozilla.org/show_bug.cgi?id=675533
+        window.setTimeout(manualEdit, 4000);
+
         navigator.geolocation.getCurrentPosition(geoSuccess, manualEdit);
+      } else {
+        manualEdit();
       }
     });
   }