mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01: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 observer = new MutationObserver((mutationsList) => {
|
||||
for (const mutation of mutationsList) {
|
||||
if (mutation.type === 'childList' || mutation.type === 'subtree') {
|
||||
Livewire.on('purchase.next', (event) => {
|
||||
document.getElementById('spinner').classList.remove('hidden');
|
||||
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 })
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
Loading…
Reference in New Issue
Block a user