X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e443ec7587e78564deadd34f0aebde02c83437cc..58f0eea2a4aba52858361915157a06d0087a99e4:/app/assets/javascripts/index/directions.js diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index ad780d4f4..500610e26 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -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 += "