Use an id instead of a function
This commit is contained in:
parent
4b8ebbcc5a
commit
3a4ef0f57d
1 changed files with 3 additions and 6 deletions
|
@ -92,6 +92,7 @@ function defocusSearchBar() {
|
||||||
var disableShortcuts = getCurrentValue("rustdoc-disable-shortcuts") === "true";
|
var disableShortcuts = getCurrentValue("rustdoc-disable-shortcuts") === "true";
|
||||||
var search_input = getSearchInput();
|
var search_input = getSearchInput();
|
||||||
var searchTimeout = null;
|
var searchTimeout = null;
|
||||||
|
var toggleAllDocsId = "toggle-all-docs";
|
||||||
|
|
||||||
// On the search screen, so you remain on the last tab you opened.
|
// On the search screen, so you remain on the last tab you opened.
|
||||||
//
|
//
|
||||||
|
@ -2113,12 +2114,8 @@ function defocusSearchBar() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getToggleAllDocsElement() {
|
|
||||||
return document.getElementById("toggle-all-docs");
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleAllDocs(pageId, fromAutoCollapse) {
|
function toggleAllDocs(pageId, fromAutoCollapse) {
|
||||||
var innerToggle = getToggleAllDocsElement();
|
var innerToggle = document.getElementById(toggleAllDocsId);
|
||||||
if (!innerToggle) {
|
if (!innerToggle) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2360,7 +2357,7 @@ function defocusSearchBar() {
|
||||||
}
|
}
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var toggles = document.getElementById("toggle-all-docs");
|
var toggles = document.getElementById(toggleAllDocsId);
|
||||||
if (toggles) {
|
if (toggles) {
|
||||||
toggles.onclick = toggleAllDocs;
|
toggles.onclick = toggleAllDocs;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue