X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e6dbf56d43de52513a9e80367d8c2eb4e7bc21a1..ea152a7ead074d241fd581319ab6a921ef02c6c2:/app/assets/javascripts/index/directions.js diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index ee44ad4c4..500610e26 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,29 @@ 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 += "