Merge pull request #3672 from AntonKhorev/geolink-button

Remove geolink and close button nesting
This commit is contained in:
Andy Allan 2022-09-01 09:17:11 +01:00 committed by GitHub
commit bf11e06e63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View file

@ -265,6 +265,7 @@ OSM.Directions = function (map) {
}
var turnByTurnTable = $("<table class='mb-3'>");
var directionsCloseButton = $("<button type='button' class='btn-close mt-1'>");
$("#sidebar_content")
.empty()
@ -273,9 +274,7 @@ OSM.Directions = function (map) {
$("<div class='flex-grow-1 text-break'>").append(
$("<h2>")
.text(I18n.t("javascripts.directions.directions"))),
$("<div>").append(
$("<a class='geolink' href='#'>").append(
$("<button type='button' class='btn-close mt-1'>")))),
$("<div>").append(directionsCloseButton)),
distanceText,
turnByTurnTable
);
@ -327,8 +326,7 @@ OSM.Directions = function (map) {
I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
"</p>");
$("#sidebar_content a.geolink").on("click", function (e) {
e.preventDefault();
directionsCloseButton.on("click", function () {
map.removeLayer(polyline);
$("#sidebar_content").html("");
map.setSidebarOverlaid(true);

View file

@ -3,8 +3,6 @@
<h2><%= title %></h2>
</div>
<div>
<a class="geolink" href="<%= root_path %>">
<button type="button" class="btn-close mt-1"></button>
</a>
<a class="geolink d-block btn-close mt-1" href="<%= root_path %>"></a>
</div>
</div>