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.css("background-color", "#fff");
+ input.removeClass("error");
});
input.on("change", function (e) {
endpoint.setValue = function(value, latlng) {
endpoint.value = value;
delete endpoint.latlng;
+ input.removeClass("error");
input.val(value);
if (latlng) {
endpoint.awaitingGeocode = false;
endpoint.hasGeocode = true;
if (json.length === 0) {
- alert(I18n.t('javascripts.directions.errors.no_place_with_name', {place: endpoint.value}));
- input.css("background-color", "rgba(255, 0, 0, 0.5)");
+ input.addClass("error");
+ alert(I18n.t('javascripts.directions.errors.no_place', {place: endpoint.value}));
return;
}