]> git.openstreetmap.org Git - rails.git/commitdiff
Refactor the directions table to use bootstrap table styling
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 13 Sep 2023 10:30:50 +0000 (11:30 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 13 Sep 2023 10:30:50 +0000 (11:30 +0100)
This allows us to remove some custom CSS

app/assets/javascripts/index/directions.js
app/assets/stylesheets/common.scss

index 7bd0891a34e920956f0e80c3ed12a0f59e4bd9f7..c86c8ad02ccde0813d9ae03c6011505bd6933536 100644 (file)
@@ -268,7 +268,8 @@ OSM.Directions = function (map) {
           I18n.t("javascripts.directions.descend") + ": " + formatHeight(route.descend) + ".");
       }
 
-      var turnByTurnTable = $("<table class='mb-3'>");
+      var turnByTurnTable = $("<table class='table table-sm mb-3'>")
+        .append($("<tbody>"));
       var directionsCloseButton = $("<button type='button' class='btn-close'>")
         .attr("aria-label", I18n.t("javascripts.close"));
 
@@ -304,8 +305,8 @@ OSM.Directions = function (map) {
         }
 
         var row = $("<tr class='turn'/>");
-        row.append("<td><div class='direction i" + direction + "'/></td> ");
-        row.append("<td class='instruction'>" + instruction);
+        row.append("<td class='border-0'><div class='direction i" + direction + "'/></td> ");
+        row.append("<td>" + instruction);
         row.append("<td class='distance'>" + dist);
 
         row.on("click", function () {
index b8c874fb8d2194e76977a8320f6c79349291259c..881ee6e3485691fc1acbd42515c688b0a5e56472 100644 (file)
@@ -698,11 +698,6 @@ div.direction {
 div.direction.i#{$i} { background-position: #{($i)*-20}px 0px; }
 }
 
-td.instruction, td.distance {
-    padding-top: $lineheight/5;
-    padding-bottom: $lineheight/5;
-    border-bottom: 1px solid $grey;
-}
 td.distance {
     color: $darkgrey;
     text-align: right;