jsrouting: don't close the smallscreen header until both geocodes entered
authorDan Stowell <danstowell@users.sourceforge.net>
Sun, 8 Feb 2015 11:11:53 +0000 (11:11 +0000)
committerDan Stowell <danstowell@users.sourceforge.net>
Sun, 8 Feb 2015 11:11:53 +0000 (11:11 +0000)
app/assets/javascripts/index/directions.js.erb

index 72299ea..7b1ef3c 100644 (file)
@@ -163,6 +163,7 @@ OSM.Directions = function (map) {
         d = endpoints[1].latlng;
 
     if (!o || !d) return;
+    $("header").addClass("closed");
 
     var precision = OSM.zoomPrecision(map.getZoom());
 
@@ -295,7 +296,6 @@ OSM.Directions = function (map) {
 
   $(".directions_form").on("submit", function(e) {
     e.preventDefault();
-    $("header").addClass("closed");
     getRoute();
   });