]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/1804'
authorTom Hughes <tom@compton.nu>
Mon, 2 Apr 2018 14:41:35 +0000 (15:41 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 2 Apr 2018 14:41:35 +0000 (15:41 +0100)
1  2 
app/assets/javascripts/index/directions.js

index 1057fa58d5337077a1401ad7bd864cff355daa22,392183cc601263ac24eaaac37be189c24b555e25..2b3319f8f35c1e95279b88af763c5b348ac78521
@@@ -40,7 -40,8 +40,8 @@@ OSM.Directions = function (map) 
          shadowUrl: OSM.MARKER_SHADOW,
          shadowSize: [41, 41]
        }),
-       draggable: true
+       draggable: true,
+       autoPan: true
      });
  
      endpoint.marker.on('drag dragend', function (e) {
        }
      });
  
 +    input.on("keydown", function() {
 +      input.removeClass("error");
 +    });
 +
      input.on("change", function (e) {
        awaitingGeocode = true;
        
@@@ -90,8 -87,7 +91,8 @@@
          endpoint.awaitingGeocode = false;
          endpoint.hasGeocode = true;
          if (json.length === 0) {
 -          alert(I18n.t('javascripts.directions.errors.no_place'));
 +          input.addClass("error");
 +          alert(I18n.t('javascripts.directions.errors.no_place', {place: endpoint.value}));
            return;
          }