Rework to include "spinner" icon for loading state and dark mode
support.
This commit is contained in:
parent
bd59a73859
commit
32a7c08d95
3 changed files with 39 additions and 3 deletions
|
|
@ -179,21 +179,24 @@ export const bindModals = () => {
|
|||
dialog[0]?.showModal();
|
||||
dialog[0]?.setAttribute('data-scripture', scripture);
|
||||
dialog[0]?.classList.remove("hidden");
|
||||
//document.body.classList.add("overflow-hidden");
|
||||
dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.remove('hidden');
|
||||
|
||||
fetch(uri)
|
||||
.then((response) => {
|
||||
console.log(response.ok);
|
||||
return response.json();
|
||||
})
|
||||
.then((response) => {
|
||||
render(dialog[0], response, refs);
|
||||
dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.add('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
dialog[0]?.addEventListener('click', (evt) => {
|
||||
if (evt.target === dialog[0]) {
|
||||
dialog[0]?.close();
|
||||
dialog[0]?.classList.add('hidden');
|
||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
dialog[0]?.querySelector('a.bg span').replaceChildren();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue