{"version":3,"sources":["Core/CookieBannerPlaceholder.ts"],"names":["define","require","exports","Object","defineProperty","value","CookieBannerPlaceholder","[object Object]","this","_topNav","document","querySelector","_secNav","_cookieBanner","_consentButton","setNavPosition","cookieBannerHeight","scrollHeight","style","top","resetNavPosition","removeProperty","addEventListener","window"],"mappings":"AAAAA,OAAO,CAAC,UAAW,WAAY,SAAUC,EAASC,GAC9C,aACAC,OAAOC,eAAeF,EAAS,aAAc,CAAEG,OAAO,IACtDH,EAAQI,6BAA0B,EA6BlCJ,EAAQI,wBA5BR,MACIC,cACIC,KAAKC,QAAUC,SAASC,cAAc,UACtCH,KAAKI,QAAUF,SAASC,cAAc,kBACtCH,KAAKK,cAAgBH,SAASC,cAAc,kBAC5CH,KAAKM,eAAiBJ,SAASC,cAAc,wBAC7C,MAAMI,EAAiB,KACnB,IAAKP,KAAKK,cACN,OACJ,MAAMG,EAAqBR,KAAKK,cAAcI,aAC9CT,KAAKC,QAAQS,MAAMC,IAAMH,EAAqB,KAC9CR,KAAKI,QAAQM,MAAMC,IAAOH,EAAqBR,KAAKC,QAAQQ,aAAgB,MAE1EG,EAAmB,KACrBZ,KAAKC,QAAQS,MAAMG,eAAe,OAClCb,KAAKI,QAAQM,MAAMG,eAAe,QAElCb,KAAKM,gBACLN,KAAKM,eAAeQ,iBAAiB,QAAS,KAC1CF,MAGRG,OAAOD,iBAAiB,SAAU,KAC9BP,MAEJA","sourcesContent":["export class CookieBannerPlaceholder {\r\n\r\n //move the navigation elements down if the cookie banner is displayed\r\n\r\n private _topNav: HTMLElement = document.querySelector(\"header\");\r\n private _secNav: HTMLElement = document.querySelector(\".second-header\");\r\n private _cookieBanner: HTMLElement = document.querySelector(\"#cookieConsent\");\r\n private _consentButton: HTMLElement = document.querySelector(\"#cookieConsentButton\");\r\n\r\n constructor() {\r\n \r\n // functions\r\n const setNavPosition = () => {\r\n if (!this._cookieBanner) return; // if no cookie banner is displayed, do not do anything\r\n\r\n const cookieBannerHeight: number = this._cookieBanner.scrollHeight;\r\n this._topNav.style.top = cookieBannerHeight + \"px\";\r\n this._secNav.style.top = (cookieBannerHeight + this._topNav.scrollHeight) + \"px\";\r\n }\r\n\r\n const resetNavPosition = () => {\r\n this._topNav.style.removeProperty(\"top\");\r\n this._secNav.style.removeProperty(\"top\");\r\n }\r\n\r\n // on click of the cookie consent button, reset the nav positions\r\n if (this._consentButton) {\r\n this._consentButton.addEventListener(\"click\", () => {\r\n resetNavPosition();\r\n })\r\n }\r\n\r\n // make sure heights are correct after resizing the window\r\n window.addEventListener(\"resize\", () => {\r\n setNavPosition();\r\n })\r\n\r\n // initialization\r\n setNavPosition();\r\n }\r\n}\r\n\r\n\r\n\r\n"],"file":"CookieBannerPlaceholder.js"}