Changeset 3170331
- Timestamp:
- 10/16/2024 08:37:50 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
checkoutchamp/trunk/includes/functions/Functions_Loader.php
r3154154 r3170331 69 69 } 70 70 71 setButtons()72 73 setInterval(async () => {74 await setButtons();75 }, 1000);76 77 71 async function setButtons() { 78 72 try { … … 209 203 } 210 204 } 205 206 jQuery(document).ready(function() { 207 // Call setButtons once when the page is loaded 208 setButtons(); 209 210 // Use MutationObserver to detect when new buttons are added to the DOM 211 const observer = new MutationObserver(function(mutations) { 212 mutations.forEach(function(mutation) { 213 if (mutation.addedNodes.length) { 214 setButtons(); // Re-run the button setup logic 215 } 216 }); 217 }); 218 219 // Start observing the DOM for changes 220 observer.observe(document.body, { 221 childList: true, 222 subtree: true 223 }); 224 }); 211 225 </script> 212 226 <?php
Note: See TracChangeset
for help on using the changeset viewer.