Skip to content

Commit 86e42c2

Browse files
Delay help popup creation to when it's needed
1 parent 1727c7a commit 86e42c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustdoc/html/static/main.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ function defocusSearchBar() {
344344
}
345345

346346
function getHelpElement() {
347+
buildHelperPopup();
347348
return document.getElementById("help");
348349
}
349350

@@ -2818,12 +2819,12 @@ function defocusSearchBar() {
28182819

28192820
popup.appendChild(container);
28202821
insertAfter(popup, getSearchElement());
2822+
// So that it's only built once and then it'll do nothing when called!
2823+
buildHelperPopup = function() {};
28212824
}
28222825

28232826
onHashChange(null);
28242827
window.onhashchange = onHashChange;
2825-
2826-
buildHelperPopup();
28272828
}());
28282829

28292830
// This is required in firefox. Explanations: when going back in the history, firefox doesn't re-run

0 commit comments

Comments
 (0)