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: 73932b637a61134b635e226dbc4d82c0ae2781746bec3415cbc0258755ad66ed
4
- data.tar.gz: a37caeb6e0bd066dd44a29a9b0f060a4eea4dcd02cbfaf53fc588704810875a6
3
+ metadata.gz: 9c84de53471957c594cca1e13b31d978ff333d344ee519243e8621b2c71ba358
4
+ data.tar.gz: d3ff284dfa3d26b49122cfcbb0e7ce9c94477c723b90b59c8d6fac53ac6852f2
5
5
  SHA512:
6
- metadata.gz: 9b5b97b5f24c775c3a304f0e345f1ea0dd332879813e44fe409fd5547e10f92a228a30c00dfc24daf3806568b4ff1d3d60ba1f44ee360f3c0c87cebde703f1e7
7
- data.tar.gz: 502a5a77109b36d419fa301bcdb4459f8deedf010afa8faf64dca71d16f64b2845f2041ce1b124c6ce4435180900bfddccd6ffa3b6435171d61551ac4419aa25
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
- document.addEventListener("DOMContentLoaded", () => {
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? %>
@@ -1,3 +1,3 @@
1
1
  module ImmosquareCookies
2
- VERSION = "2.0.2".freeze
2
+ VERSION = "2.0.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-cookies
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - immosquare