Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve help popup #75976

Merged
merged 2 commits into from
Aug 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ function defocusSearchBar() {
}

function getHelpElement() {
buildHelperPopup();
return document.getElementById("help");
}

Expand Down Expand Up @@ -2797,8 +2798,8 @@ function defocusSearchBar() {

var infos = [
"Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to \
restrict the search to a given type.",
"Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, \
restrict the search to a given item kind.",
"Accepted kinds are: <code>fn</code>, <code>mod</code>, <code>struct</code>, \
<code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, \
and <code>const</code>.",
"Search functions by type signature (e.g., <code>vec -&gt; usize</code> or \
Expand All @@ -2818,12 +2819,12 @@ function defocusSearchBar() {

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

onHashChange(null);
window.onhashchange = onHashChange;

buildHelperPopup();
}());

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