From: Andy Allan Date: Wed, 31 Aug 2022 14:04:45 +0000 (+0100) Subject: Merge pull request #3666 from AntonKhorev/flex-close-buttons X-Git-Tag: live~2375 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/04ff7d4ee81040f152c38ee39ba84491c91a66f3?hp=a9b77d60c8aa821202ff945c0f60af80dfb25d73 Merge pull request #3666 from AntonKhorev/flex-close-buttons Position close buttons with flexbox --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 40f546009..5ba36a455 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -1,5 +1,6 @@ //= require_self //= require leaflet.sidebar +//= require leaflet.sidebar-pane //= require leaflet.locatecontrol/src/L.Control.Locate //= require leaflet.layers //= require leaflet.key diff --git a/app/assets/javascripts/index/browse.js b/app/assets/javascripts/index/browse.js index 8ef859d85..61319f7b4 100644 --- a/app/assets/javascripts/index/browse.js +++ b/app/assets/javascripts/index/browse.js @@ -48,21 +48,20 @@ OSM.initializeBrowse = function (map) { function displayFeatureWarning(count, limit, add, cancel) { $("#browse_status").html( - $("
") - .append( - $("" + - "

" + 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( + $("
").append( + $("

") + .text(I18n.t("javascripts.directions.directions"))), + $("
").append( + $("").append( + $("

diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index 47e9ad557..9ce1265b4 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -19,7 +19,7 @@
-
+