Skip to content

Instantly share code, notes, and snippets.

@wplit
Created July 30, 2025 06:57
Show Gist options
  • Select an option

  • Save wplit/d7283641f408e64d46de7c6fe1cf2161 to your computer and use it in GitHub Desktop.

Select an option

Save wplit/d7283641f408e64d46de7c6fe1cf2161 to your computer and use it in GitHub Desktop.
trigger timeout when modal opens
document.addEventListener('DOMContentLoaded', () => {
const observer = new MutationObserver((mutationsList) => {
for (const mutation of mutationsList) {
if (
mutation.type === 'attributes' &&
mutation.attributeName === 'class'
) {
const target = mutation.target;
if (
target.classList.contains('live')
) {
window.dispatchEvent(new Event('resize'));
}
}
}
});
observer.observe(document.querySelector('#%%ELEMENT_ID%%').closest('.oxy-modal-backdrop'), { attributes: true });
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment