immosquare-cookies 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c84de53471957c594cca1e13b31d978ff333d344ee519243e8621b2c71ba358
|
|
4
|
+
data.tar.gz: d3ff284dfa3d26b49122cfcbb0e7ce9c94477c723b90b59c8d6fac53ac6852f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 309915c1bb838ee4d22752a17699cdc7816b314a94324d82a1a5d582930e3d50ba67951240fc542211c163e356ca41a259f6d003a01f99ae267a5faf8ca76d14
|
|
7
|
+
data.tar.gz: 9116c60b6423bc9462b5076751d2749d04ac80bcb50508191349710c6148f6a748021cfbb8ddba28ca5053e0512b928488efd241d2c99dcabf17e28e05f928c7
|
|
@@ -35,7 +35,11 @@ cookies_to_remove = [] if !defined?(cookies_to_remove)
|
|
|
35
35
|
</div>
|
|
36
36
|
|
|
37
37
|
<script>
|
|
38
|
-
|
|
38
|
+
// Using an IIFE instead of DOMContentLoaded for Turbo Drive compatibility.
|
|
39
|
+
// Turbo replaces the <body> on navigation without firing DOMContentLoaded again.
|
|
40
|
+
// Since this partial is conditionally rendered server-side, the inline script
|
|
41
|
+
// executes immediately each time Turbo inserts it into the DOM.
|
|
42
|
+
(() => {
|
|
39
43
|
const cookieContainer = document.getElementById("immosquare-cookies-container");
|
|
40
44
|
const cookieName = cookieContainer.dataset.name;
|
|
41
45
|
const cookieDurationMonths = cookieContainer.dataset.durationMonths;
|
|
@@ -87,6 +91,6 @@ cookies_to_remove = [] if !defined?(cookies_to_remove)
|
|
|
87
91
|
|
|
88
92
|
document.getElementById("immosquare-cookies-refuse").addEventListener("click", function() { handleCookieConsent(false); });
|
|
89
93
|
document.getElementById("immosquare-cookies-accept").addEventListener("click", function() { handleCookieConsent(true); });
|
|
90
|
-
});
|
|
94
|
+
})();
|
|
91
95
|
</script>
|
|
92
96
|
<% end if cookies && cookies[cookie_name].blank? %>
|