Skip to content

Commit 9a25901

Browse files
committed
hash opening
1 parent 174cdda commit 9a25901

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

public/scripts.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/scripts.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ document.addEventListener('DOMContentLoaded', function () {
55
initializeCookieBanner();
66
initializeCookiePolicyLink();
77
openCookieBannerByHash();
8+
initializeConsentSettingsLink();
89
});
910

1011
/**
@@ -372,3 +373,18 @@ window.toggleCookieBanner = function () {
372373
}
373374
}
374375
};
376+
377+
/**
378+
* Ensures that clicking any link with href="#consent-settings" always opens the cookie banner dialog.
379+
*/
380+
function initializeConsentSettingsLink() {
381+
document.querySelectorAll('a[href="#consent-settings"]').forEach(link => {
382+
link.addEventListener('click', function (e) {
383+
e.preventDefault();
384+
window.location.hash = '#consent-settings'; // Optional: update hash for consistency
385+
if (typeof window.toggleCookieBanner === 'function') {
386+
window.toggleCookieBanner();
387+
}
388+
});
389+
});
390+
}

0 commit comments

Comments
 (0)