about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/main.js
diff options
context:
space:
mode:
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-01-12 15:05:47 -0800
committerJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-01-17 11:45:28 -0800
commit43b9268592187e9d757e68ae0cf10ee3da68e424 (patch)
treefaf663f62fd6cfbcb4e2fb5b47f6dc262456ce82 /src/librustdoc/html/static/js/main.js
parentee5d8d37baaf5b5a81a98396952839c73ae41c68 (diff)
downloadrust-43b9268592187e9d757e68ae0cf10ee3da68e424.tar.gz
rust-43b9268592187e9d757e68ae0cf10ee3da68e424.zip
Rustdoc style cleanups
 - Make "since" version numbers grey again (regressed in #92602).
 - Remove unneeded selectors for when crate filter dropdown is a
   sibling of search-input.
 - Crate filter dropdown doesn't need to be 100% width on mobile.
 - Only build crate filter dropdown when there is more than one crate.
 - Remove unused addCrateDropdown.
Diffstat (limited to 'src/librustdoc/html/static/js/main.js')
-rw-r--r--src/librustdoc/html/static/js/main.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index f41c1bd817a..f9443982726 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -283,9 +283,6 @@ function hideThemeButtonState() {
                 loadSearch();
             }
 
-            // `crates{version}.js` should always be loaded before this script, so we can use it
-            // safely.
-            searchState.addCrateDropdown(window.ALL_CRATES);
             var params = searchState.getQueryStringParams();
             if (params.search !== undefined) {
                 var search = searchState.outputElement();
@@ -295,30 +292,6 @@ function hideThemeButtonState() {
                 loadSearch();
             }
         },
-        addCrateDropdown: function(crates) {
-            var elem = document.getElementById("crate-search");
-
-            if (!elem) {
-                return;
-            }
-            var savedCrate = getSettingValue("saved-filter-crate");
-            for (var i = 0, len = crates.length; i < len; ++i) {
-                var option = document.createElement("option");
-                option.value = crates[i];
-                option.innerText = crates[i];
-                elem.appendChild(option);
-                // Set the crate filter from saved storage, if the current page has the saved crate
-                // filter.
-                //
-                // If not, ignore the crate filter -- we want to support filtering for crates on
-                // sites like doc.rust-lang.org where the crates may differ from page to page while
-                // on the
-                // same domain.
-                if (crates[i] === savedCrate) {
-                    elem.value = savedCrate;
-                }
-            }
-        },
     };
 
     function getPageId() {