A graphviz extension for odoc
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix SPA init: poll for CDN scripts from initial load, not just observer

The MutationObserver only fires on future mutations. When the init
script loads after content swap (SPA), the content is already in the
DOM and no mutations will fire. Start polling for the CDN library
immediately from init(), not just from the observer callback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+11 -6
+11 -6
src/dot_extension.ml
··· 145 145 }); 146 146 } 147 147 148 + function init() { 149 + renderAll(); 150 + observe(); 151 + if (typeof Viz === 'undefined' && 152 + document.querySelectorAll('.odoc-dot-diagram:not([data-dot-init])').length > 0) { 153 + waitForViz(); 154 + } 155 + } 156 + 148 157 if (document.readyState === 'loading') { 149 - document.addEventListener('DOMContentLoaded', function() { 150 - renderAll(); 151 - observe(); 152 - }); 158 + document.addEventListener('DOMContentLoaded', init); 153 159 } else { 154 - renderAll(); 155 - observe(); 160 + init(); 156 161 } 157 162 158 163 function observe() {