From: Anton Khorev Date: Sat, 27 Aug 2022 21:32:50 +0000 (+0300) Subject: Position directions close button with flex X-Git-Tag: live~1531^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/f41b5558b7230f2d557c358febf0ed9b669407c7?ds=sidebyside Position directions close button with flex --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index ad780d4f4..0c867a97d 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -254,20 +254,31 @@ OSM.Directions = function (map) { map.fitBounds(polyline.getBounds().pad(0.05)); } - var html = "" + - "

" + I18n.t("javascripts.directions.directions") + "

" + - "

" + + 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 += "

"; + + var turnByTurnTable = $("
"); $("#sidebar_content") - .html(html); + .empty() + .append( + $("
").append( + $("