]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions.js
Rework sidebar to use padding on the sidebar_content div
[rails.git] / app / assets / javascripts / index / directions.js
index 93024d0a90c4e71223cef1eb0aba7a6c17c2491c..5040e7f3ef0d404b449f9fe28895fbf40bbc480e 100644 (file)
@@ -256,7 +256,7 @@ OSM.Directions = function (map) {
 
       var html = "<h2><a class=\"geolink\" href=\"#\">" +
         "<span class=\"icon close\"></span></a>" + I18n.t("javascripts.directions.directions") +
-        "</h2><p id=\"routing_summary\">" +
+        "</h2><p>" +
         I18n.t("javascripts.directions.distance") + ": " + formatDistance(route.distance) + ". " +
         I18n.t("javascripts.directions.time") + ": " + formatTime(route.time) + ".";
       if (typeof route.ascend !== "undefined" && typeof route.descend !== "undefined") {
@@ -264,7 +264,7 @@ OSM.Directions = function (map) {
           I18n.t("javascripts.directions.ascend") + ": " + Math.round(route.ascend) + "m. " +
           I18n.t("javascripts.directions.descend") + ": " + Math.round(route.descend) + "m.";
       }
-      html += "</p><table id=\"turnbyturn\" />";
+      html += "</p><table id=\"turnbyturn\" class=\"mb-3\"/>";
 
       $("#sidebar_content")
         .html(html);
@@ -312,7 +312,7 @@ OSM.Directions = function (map) {
         $("#turnbyturn").append(row);
       });
 
-      $("#sidebar_content").append("<p id=\"routing_credit\">" +
+      $("#sidebar_content").append("<p class=\"text-center\">" +
         I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
         "</p>");
 
@@ -334,7 +334,7 @@ OSM.Directions = function (map) {
 
   select.on("change", function (e) {
     chosenEngine = engines[e.target.selectedIndex];
-    Cookies.set("_osm_directions_engine", chosenEngine.id, { secure: true, expires: expiry, path: "/" });
+    Cookies.set("_osm_directions_engine", chosenEngine.id, { secure: true, expires: expiry, path: "/", samesite: "lax" });
     getRoute(true, true);
   });