Changed close buttons of banner and other leaflet sidebars to Bootstrap

This commit is contained in:
Anton Khorev 2022-07-27 20:00:22 +03:00
parent 5ed2bfc950
commit 0322ed4295
5 changed files with 6 additions and 25 deletions

View file

@ -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

@ -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

@ -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>")

View file

@ -55,7 +55,6 @@ small, aside {
.icon.clipboard { /* no-r2 */ background-position: -160px 0; }
.icon.link { /* no-r2 */ background-position: -180px 0; }
.icon.close { /* no-r2 */ background-position: -200px 0; }
.close-wrap:hover .icon.close,
.icon.close:hover { /* no-r2 */ background-position: -200px -20px; }
.icon.check { /* no-r2 */ background-position: -220px 0; }
.icon.note { /* no-r2 */ background-position: -240px 0; }
@ -366,22 +365,6 @@ body.compact-nav {
h3, h4 {
font-size: 1.25rem;
}
.close-wrap {
cursor: pointer;
position: absolute;
top: 0;
right: 0;
width: 60px;
height: 60px;
.icon.close {
pointer-events: none;
position: absolute;
right: 20px;
top: 20px;
}
}
}
.overlay-sidebar #sidebar {

View file

@ -1,4 +1,4 @@
<% unless (banner = next_banner()).nil? %>
<%= link_to (image_tag banner[:img], :alt => banner[:alt], :title => banner[:alt]), banner[:link] %>
<div class="close-wrap" id="<%= banner_cookie(banner[:id]) %>"><span class="icon close"></span></div>
<button type="button" class="btn-close position-absolute top-0 end-0 p-4" id="<%= banner_cookie(banner[:id]) %>"></button>
<% end %>