Merge pull request #3631 from AntonKhorev/bootstrap-close

Use Bootstrap close button
This commit is contained in:
Andy Allan 2022-08-03 11:47:08 +01:00 committed by GitHub
commit 6b69655812
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 18 additions and 42 deletions

View file

@ -195,7 +195,7 @@ $(document).ready(function () {
$(".welcome").addClass("visible");
}
$(".welcome .close").on("click", function () {
$(".welcome .btn-close").on("click", function () {
$(".welcome").removeClass("visible");
Cookies.set("_osm_welcome", "hide", { secure: true, expires: expiry, path: "/", samesite: "lax" });
});
@ -203,7 +203,7 @@ $(document).ready(function () {
var bannerExpiry = new Date();
bannerExpiry.setYear(bannerExpiry.getFullYear() + 1);
$("#banner .close-wrap").on("click", function (e) {
$("#banner .btn-close").on("click", function (e) {
var cookieId = e.target.id;
$("#banner").hide();
e.preventDefault();

View file

@ -50,10 +50,11 @@ OSM.initializeBrowse = function (map) {
$("#browse_status").html(
$("<div>")
.append(
$("<button type='button' class='btn-close float-end mt-1'>")
.click(cancel),
$("<h2>")
.text(I18n.t("browse.start_rjs.load_data"))
.prepend($("<span class='icon close'></span>").click(cancel)))
.append(
.prepend(),
$("<div>")
.append(
$("<p class='alert alert-warning clearfix'></p>")

View file

@ -157,7 +157,7 @@ OSM.Directions = function (map) {
}));
});
$(".directions_form .close").on("click", function (e) {
$(".directions_form .btn-close").on("click", function (e) {
e.preventDefault();
var route_from = endpoints[0].value;
if (route_from) {
@ -254,9 +254,9 @@ OSM.Directions = function (map) {
map.fitBounds(polyline.getBounds().pad(0.05));
}
var html = "<h2><a class=\"geolink\" href=\"#\">" +
"<span class=\"icon close\"></span></a>" + I18n.t("javascripts.directions.directions") +
"</h2><p>" +
var html = "<a class=\"geolink\" href=\"#\"><button type='button' class='btn-close float-end mt-1'></button></a>" +
"<h2>" + I18n.t("javascripts.directions.directions") + "</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") {

View file

@ -19,9 +19,8 @@ L.OSM.key = function (options) {
.attr("class", "sidebar_heading")
.appendTo($ui)
.append(
$("<span>")
.text(I18n.t("javascripts.close"))
.attr("class", "icon close")
$("<button type='button' class='btn-close float-end mt-1'>")
.attr("aria-label", I18n.t("javascripts.close"))
.bind("click", toggle))
.append(
$("<h4>")

View file

@ -22,9 +22,8 @@ L.OSM.layers = function (options) {
.attr("class", "sidebar_heading")
.appendTo($ui)
.append(
$("<span>")
.text(I18n.t("javascripts.close"))
.attr("class", "icon close")
$("<button type='button' class='btn-close float-end mt-1'>")
.attr("aria-label", I18n.t("javascripts.close"))
.bind("click", toggle))
.append(
$("<h4>")

View file

@ -25,9 +25,8 @@ L.OSM.share = function (options) {
.attr("class", "sidebar_heading")
.appendTo($ui)
.append(
$("<span>")
.text(I18n.t("javascripts.close"))
.attr("class", "icon close")
$("<button type='button' class='btn-close float-end mt-1'>")
.attr("aria-label", I18n.t("javascripts.close"))
.bind("click", toggle))
.append(
$("<h4>")