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accordion4/./src/ts/lib-2sxc-bs5-accordion.ts","webpack://app-accordion4/webpack/bootstrap"],"sourcesContent":["import { initAccordionBs5 } from './lib-2sxc-bs5-accordion';\r\n\r\nvar winAny = window as any;\r\nwinAny.appAccordion4 ??= {};\r\nwinAny.appAccordion4.initBs5 ??= initAccordionBs5;","import { AccordionOptions } from './lib-2sxc-accordion-options';\r\n\r\n/*\r\n This is a shared code used in various 2sxc apps. Make sure that they are in sync, so if you improve it, improve all 2sxc apps which use this. \r\n ATM they are:\r\n - Accordion\r\n - FAQ\r\n - App School System\r\n\r\n The master with the newest / best version must always be the Accordion, the others should then get a fresh copy.\r\n Because this is shared, all parameters like DOM-IDs etc. must be provided in the Init-call that it can work across apps\r\n*/ \r\n\r\nexport function initAccordionBs5({ domId, options } : { domId: string, options: AccordionOptions }) {\r\n // get navHight for correct scrollposition\r\n var nav = (document.getElementsByTagName(options.tagStickyHeader)[0] as HTMLElement);\r\n var navHeight = (nav != null ? nav.offsetHeight : 0);\r\n\r\n let accordionWrapper = document.querySelector(`[${domId}]`)\r\n\r\n // attach click to all accordions when loading\r\n var accordionOpener = accordionWrapper.querySelectorAll(`[${options.attrParent}]`);\r\n\r\n accordionOpener.forEach((elem: HTMLElement) => {\t\r\n elem.addEventListener('click', (event) => {\r\n event.preventDefault();\r\n\r\n const hash = elem.getAttribute(options.attrParent);\r\n \r\n // add hash to url\r\n location.hash = hash;\r\n })\r\n });\r\n\r\n // get hash from url and open specific item\r\n if(window.location.hash){\r\n const hash = window.location.hash;\r\n const targetButton = accordionWrapper.querySelector(`[${options.attrParent}=\"${hash}\"]`);\r\n const targetContent = accordionWrapper.querySelector(hash);\r\n \r\n // if target element exists scroll to element and open it\r\n if(targetButton && targetContent){\r\n const elemOffsetX = targetContent.getBoundingClientRect().top + window.scrollY - navHeight;\r\n targetContent.classList.toggle(`${options.classIsExpanded}`);\r\n targetButton.classList.toggle(`${options.classInactive}`);\r\n\r\n // scroll to element which should open then\r\n window.scrollTo({\r\n top: elemOffsetX,\r\n left: 0,\r\n behavior: 'smooth'\r\n });\r\n }\r\n }\r\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n"],"names":["winAny","domId","options","nav","document","getElementsByTagName","tagStickyHeader","navHeight","offsetHeight","accordionWrapper","querySelector","querySelectorAll","attrParent","forEach","elem","addEventListener","event","preventDefault","hash","getAttribute","location","window","targetButton","targetContent","elemOffsetX","getBoundingClientRect","top","scrollY","classList","toggle","classIsExpanded","classInactive","scrollTo","left","behavior","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","appAccordion4","initBs5","initAccordionBs5"],"sourceRoot":""}