aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/resources/html/js-src/init.ts
blob: 0619dfc3bbf9e29cb18d77ed5200fbd8655a9f30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as util from "./haddock-util";
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(() => {
  util.addStyleMenu();
  util.resetStyle();
  util.restoreCollapsed();
  quickJump.init();
});