Created
July 30, 2025 06:57
-
-
Save wplit/d7283641f408e64d46de7c6fe1cf2161 to your computer and use it in GitHub Desktop.
trigger timeout when modal opens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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