aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/resources/html/js-src/init.ts
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/resources/html/js-src/init.ts')
-rw-r--r--haddock-api/resources/html/js-src/init.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/haddock-api/resources/html/js-src/init.ts b/haddock-api/resources/html/js-src/init.ts
new file mode 100644
index 00000000..0619dfc3
--- /dev/null
+++ b/haddock-api/resources/html/js-src/init.ts
@@ -0,0 +1,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();
+}); \ No newline at end of file