Modal tests.
This commit is contained in:
parent
a530e8c4be
commit
2aeb21a7ba
3 changed files with 26 additions and 2 deletions
|
|
@ -3,8 +3,18 @@ export const modal = (el) => {
|
|||
};
|
||||
|
||||
export const bindModals = () => {
|
||||
const elems = document.querySelector('a[data-scripture]');
|
||||
const elems = document.querySelectorAll('a[data-scripture]');
|
||||
const dialog = document.querySelectorAll('dialog[data-scripture]');
|
||||
elems.forEach((e) => {
|
||||
console.log(e);
|
||||
e.addEventListener('click', (evt) => {
|
||||
const scripture = e.attributes.getNamedItem('data-scripture');
|
||||
evt.preventDefault();
|
||||
console.log(scripture);
|
||||
dialog[0]?.showModal();
|
||||
dialog[0]?.setAttribute('data-scripture', scripture);
|
||||
dialog[0]?.classList.remove("hidden");
|
||||
//document.body.classList.add("overflow-hidden");
|
||||
|
||||
});
|
||||
});
|
||||
};
|
||||
Loading…
Reference in a new issue