aboutsummaryrefslogblamecommitdiff
path: root/haddock-api/resources/html/js-src/init.ts
blob: 877874ae790576d0e657099b73adf3966eebb565 (plain) (tree)
1
2
                                                  













                                                         

                                            
                   
import * as styleMenu from "./style-menu";
import * as detailsHelper from "./details-helper";
import * as quickJump from "./quick-jump";

function onDomReady(callback: () => void) {
  if (document.readyState === 'interactive') {
    callback();
  } else {
    document.addEventListener('readystatechange', () => {
      if (document.readyState === 'interactive') {
        callback();
      }
    });
  }
}

onDomReady(() => {
  document.body.classList.add('js-enabled');
  styleMenu.init();
  detailsHelper.init();
  quickJump.init();
});