Remove consent banner if already set
This commit is contained in:
parent
035683f75d
commit
89685e9718
2
js/consent.min.js
vendored
2
js/consent.min.js
vendored
@ -1 +1 @@
|
||||
const fcn_hasConsent=fcn_getCookie("fcn_cookie_consent")??"",fcn_consentBanner=_$$$("consent-banner");function fcn_loadConsentBanner(){fcn_consentBanner.classList.remove("hidden"),_$$$("consent-accept-button")?.addEventListener("click",(()=>{fcn_setCookie("fcn_cookie_consent","full"),fcn_consentBanner.classList.add("hidden")})),_$$$("consent-reject-button")?.addEventListener("click",(()=>{fcn_setCookie("fcn_cookie_consent","necessary"),fcn_consentBanner.classList.add("hidden")}))}fcn_consentBanner&&""===fcn_hasConsent&&fcn_loadConsentBanner();
|
||||
const fcn_hasConsent=fcn_getCookie("fcn_cookie_consent")??"",fcn_consentBanner=_$$$("consent-banner");function fcn_loadConsentBanner(){fcn_consentBanner.classList.remove("hidden"),_$$$("consent-accept-button")?.addEventListener("click",(()=>{fcn_setCookie("fcn_cookie_consent","full"),fcn_consentBanner.classList.add("hidden")})),_$$$("consent-reject-button")?.addEventListener("click",(()=>{fcn_setCookie("fcn_cookie_consent","necessary"),fcn_consentBanner.classList.add("hidden")}))}fcn_consentBanner&&""===fcn_hasConsent?fcn_loadConsentBanner():fcn_consentBanner.remove();
|
@ -5,8 +5,12 @@
|
||||
const /** @type {String} */ fcn_hasConsent = fcn_getCookie('fcn_cookie_consent') ?? '',
|
||||
/** @const {HTMLElement} */ fcn_consentBanner = _$$$('consent-banner');
|
||||
|
||||
// Show consent banner if no consent has been set
|
||||
if (fcn_consentBanner && fcn_hasConsent === '') fcn_loadConsentBanner();
|
||||
// Show consent banner if no consent has been set, remove otherwise
|
||||
if (fcn_consentBanner && fcn_hasConsent === '') {
|
||||
fcn_loadConsentBanner();
|
||||
} else {
|
||||
fcn_consentBanner.remove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load consent banner if required.
|
||||
|
Loading…
x
Reference in New Issue
Block a user