Skip to content

Commit ea0a550

Browse files
committed
Fix haskell#783 Don't show button if --quickjump not present
In the TypeScript `init.ts`, makes `quickJump.init()` (which creates the button) conditional on the presence of meta tag `hasQuickJump` with content `"true"`. In the Haskell, threads the `withQuickJump` flag result through to `headHtml` to create the meta tag, accordingly.
1 parent 2a5fc0a commit ea0a550

File tree

5 files changed

+967
-958
lines changed

5 files changed

+967
-958
lines changed

haddock-api/resources/html/haddock-bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

haddock-api/resources/html/js-src/init.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ function onDomReady(callback: () => void) {
1717
onDomReady(() => {
1818
document.body.classList.add('js-enabled');
1919
styleMenu.init();
20-
quickJump.init();
20+
const hasQJe = document.getElementsByName('hasQuickJump')[0];
21+
if (hasQJe) {
22+
if ((hasQJe as HTMLMetaElement).content == "true") {
23+
quickJump.init();}}
2124
detailsHelper.init();
2225
});

0 commit comments

Comments
 (0)