Merge pull request #3672 from AntonKhorev/geolink-button
Remove geolink and close button nesting
This commit is contained in:
commit
bf11e06e63
2 changed files with 4 additions and 8 deletions
|
@ -265,6 +265,7 @@ OSM.Directions = function (map) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var turnByTurnTable = $("<table class='mb-3'>");
|
var turnByTurnTable = $("<table class='mb-3'>");
|
||||||
|
var directionsCloseButton = $("<button type='button' class='btn-close mt-1'>");
|
||||||
|
|
||||||
$("#sidebar_content")
|
$("#sidebar_content")
|
||||||
.empty()
|
.empty()
|
||||||
|
@ -273,9 +274,7 @@ OSM.Directions = function (map) {
|
||||||
$("<div class='flex-grow-1 text-break'>").append(
|
$("<div class='flex-grow-1 text-break'>").append(
|
||||||
$("<h2>")
|
$("<h2>")
|
||||||
.text(I18n.t("javascripts.directions.directions"))),
|
.text(I18n.t("javascripts.directions.directions"))),
|
||||||
$("<div>").append(
|
$("<div>").append(directionsCloseButton)),
|
||||||
$("<a class='geolink' href='#'>").append(
|
|
||||||
$("<button type='button' class='btn-close mt-1'>")))),
|
|
||||||
distanceText,
|
distanceText,
|
||||||
turnByTurnTable
|
turnByTurnTable
|
||||||
);
|
);
|
||||||
|
@ -327,8 +326,7 @@ OSM.Directions = function (map) {
|
||||||
I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
|
I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
|
||||||
"</p>");
|
"</p>");
|
||||||
|
|
||||||
$("#sidebar_content a.geolink").on("click", function (e) {
|
directionsCloseButton.on("click", function () {
|
||||||
e.preventDefault();
|
|
||||||
map.removeLayer(polyline);
|
map.removeLayer(polyline);
|
||||||
$("#sidebar_content").html("");
|
$("#sidebar_content").html("");
|
||||||
map.setSidebarOverlaid(true);
|
map.setSidebarOverlaid(true);
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
<h2><%= title %></h2>
|
<h2><%= title %></h2>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a class="geolink" href="<%= root_path %>">
|
<a class="geolink d-block btn-close mt-1" href="<%= root_path %>"></a>
|
||||||
<button type="button" class="btn-close mt-1"></button>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue