Added a rustdoc
shortcut for collapse/expand all
Now when the user presses the "+" key all sections will collapse/expand. Also added a note to the help screen which describes this behavior.
This commit is contained in:
parent
179539f6eb
commit
ab09fbca23
3 changed files with 11 additions and 3 deletions
|
@ -124,6 +124,10 @@
|
|||
focusSearchBar();
|
||||
break;
|
||||
|
||||
case "+":
|
||||
toggleAllDocs();
|
||||
break;
|
||||
|
||||
case "?":
|
||||
if (ev.shiftKey && $("#help").hasClass("hidden")) {
|
||||
ev.preventDefault();
|
||||
|
@ -931,7 +935,7 @@
|
|||
return "\u2212"; // "\u2212" is '−' minus sign
|
||||
}
|
||||
|
||||
$("#toggle-all-docs").on("click", function() {
|
||||
function toggleAllDocs() {
|
||||
var toggle = $("#toggle-all-docs");
|
||||
if (toggle.hasClass("will-expand")) {
|
||||
toggle.removeClass("will-expand");
|
||||
|
@ -950,7 +954,9 @@
|
|||
$(".toggle-wrapper").addClass("collapsed");
|
||||
$(".collapse-toggle").children(".inner").text(labelForToggleButton(true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#toggle-all-docs").on("click", toggleAllDocs);
|
||||
|
||||
$(document).on("click", ".collapse-toggle", function() {
|
||||
var toggle = $(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue