X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0a15112423ebe2b2fece82f94ee67e3416d1cecb..48ed305163ac44e420de60d7ffc5af1a1c3950c2:/app/assets/javascripts/index/directions.js diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 18466864b..58370e9e3 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -157,7 +157,7 @@ OSM.Directions = function (map) { })); }); - $(".directions_form .close").on("click", function (e) { + $(".directions_form .btn-close").on("click", function (e) { e.preventDefault(); var route_from = endpoints[0].value; if (route_from) { @@ -254,20 +254,30 @@ OSM.Directions = function (map) { map.fitBounds(polyline.getBounds().pad(0.05)); } - var html = "
" + + var distanceText = $("
").append(
I18n.t("javascripts.directions.distance") + ": " + formatDistance(route.distance) + ". " +
- I18n.t("javascripts.directions.time") + ": " + formatTime(route.time) + ".";
+ I18n.t("javascripts.directions.time") + ": " + formatTime(route.time) + ".");
if (typeof route.ascend !== "undefined" && typeof route.descend !== "undefined") {
- html += "
" +
+ distanceText.append(
+ $("
"),
I18n.t("javascripts.directions.ascend") + ": " + Math.round(route.ascend) + "m. " +
- I18n.t("javascripts.directions.descend") + ": " + Math.round(route.descend) + "m.";
+ I18n.t("javascripts.directions.descend") + ": " + Math.round(route.descend) + "m.");
}
- html += "