]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Changed close buttons of banner and other leaflet sidebars to Bootstrap
[rails.git] / app / assets / javascripts / index.js
index a2169643f37b8e99b3264fb895fab59f2903951f..fc7780fca0b02afea1544d365693537e87be1650 100644 (file)
@@ -188,28 +188,27 @@ $(document).ready(function () {
       map.getLayersCode(),
       map._object);
 
-    $.removeCookie("_osm_location");
-    $.cookie("_osm_location", OSM.locationCookie(map), { secure: true, expires: expiry, path: "/" });
+    Cookies.set("_osm_location", OSM.locationCookie(map), { secure: true, expires: expiry, path: "/", samesite: "lax" });
   });
 
-  if ($.cookie("_osm_welcome") !== "hide") {
+  if (Cookies.get("_osm_welcome") !== "hide") {
     $(".welcome").addClass("visible");
   }
 
   $(".welcome .close").on("click", function () {
     $(".welcome").removeClass("visible");
-    $.cookie("_osm_welcome", "hide", { secure: true, expires: expiry, path: "/" });
+    Cookies.set("_osm_welcome", "hide", { secure: true, expires: expiry, path: "/", samesite: "lax" });
   });
 
   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();
     if (cookieId) {
-      $.cookie(cookieId, "hide", { secure: true, expires: bannerExpiry, path: "/" });
+      Cookies.set(cookieId, "hide", { secure: true, expires: bannerExpiry, path: "/", samesite: "lax" });
     }
   });