mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Refactor purchase.next event handling in billing portal view
This commit is contained in:
parent
fd4f24c9ad
commit
b3a5b65af2
@ -25,18 +25,15 @@
|
|||||||
|
|
||||||
const target = document.getElementById('container');
|
const target = document.getElementById('container');
|
||||||
|
|
||||||
const observer = new MutationObserver((mutationsList) => {
|
Livewire.on('purchase.next', (event) => {
|
||||||
for (const mutation of mutationsList) {
|
document.getElementById('spinner').classList.remove('hidden');
|
||||||
if (mutation.type === 'childList' || mutation.type === 'subtree') {
|
document.getElementById('container').classList.add('hidden');
|
||||||
setTimeout(() => {
|
|
||||||
document.getElementById('spinner').classList.add('hidden');
|
|
||||||
document.getElementById('container').classList.remove('hidden');
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
observer.observe(target, { childList: true, subtree: true })
|
setTimeout(() => {
|
||||||
|
document.getElementById('spinner').classList.add('hidden');
|
||||||
|
document.getElementById('container').classList.remove('hidden');
|
||||||
|
}, 1500);
|
||||||
|
})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
Loading…
x
Reference in New Issue
Block a user