Auto merge of #75976 - GuillaumeGomez:help-popup, r=jyn514
Improve help popup Fixes #75623. The second commit is just a slight improvement: the help popup won't be created until someone presses "?" or ESC. Not a big improvement in itself but considering the low amount of code required, I think it was worth the shot. r? @jyn514
This commit is contained in:
commit
397b390cc7
1 changed files with 5 additions and 4 deletions
|
@ -344,6 +344,7 @@ function defocusSearchBar() {
|
|||
}
|
||||
|
||||
function getHelpElement() {
|
||||
buildHelperPopup();
|
||||
return document.getElementById("help");
|
||||
}
|
||||
|
||||
|
@ -2807,8 +2808,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 -> usize</code> or \
|
||||
|
@ -2828,12 +2829,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue