From 3a4ef0f57d70866bbbe5e9dd8f0710b8ee942cfa Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 29 Aug 2020 12:38:50 +0200 Subject: [PATCH] Use an id instead of a function --- src/librustdoc/html/static/main.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index baf32ab9cb2..53e9115800f 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -92,6 +92,7 @@ function defocusSearchBar() { var disableShortcuts = getCurrentValue("rustdoc-disable-shortcuts") === "true"; var search_input = getSearchInput(); var searchTimeout = null; + var toggleAllDocsId = "toggle-all-docs"; // 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) { - var innerToggle = getToggleAllDocsElement(); + var innerToggle = document.getElementById(toggleAllDocsId); if (!innerToggle) { return; } @@ -2360,7 +2357,7 @@ function defocusSearchBar() { } (function() { - var toggles = document.getElementById("toggle-all-docs"); + var toggles = document.getElementById(toggleAllDocsId); if (toggles) { toggles.onclick = toggleAllDocs; }