about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-01-15 12:42:14 +0100
committerGitHub <noreply@github.com>2019-01-15 12:42:14 +0100
commit9947b3060c165ef2677c0e0454991a53ef743224 (patch)
treeb1f7665bd924ad88138b25bfe5a0601a459f37bc
parenta52ec3c9eeee89ea2ea6eb5716f5e796a0dc1cfc (diff)
parent0d695ff33089c91a68c4be0877a53a216b991f10 (diff)
downloadrust-9947b3060c165ef2677c0e0454991a53ef743224.tar.gz
rust-9947b3060c165ef2677c0e0454991a53ef743224.zip
Rollup merge of #57614 - GuillaumeGomez:fix-crate-filtering, r=QuietMisdreavus
[rustdoc] Fix crates filtering box not being filled

Currently, the filter crate box (at the left of the search input) is always empty. To get the number of keys of dictionary in JS, you need to call `Object.keys()` on it.

r? @QuietMisdreavus
-rw-r--r--src/librustdoc/html/static/main.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 9db1c686090..ceadbd5afac 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2431,7 +2431,7 @@ if (!DOMTokenList.prototype.remove) {
             return;
         }
         var crates_text = [];
-        if (crates.length > 1) {
+        if (Object.keys(crates).length > 1) {
             for (var crate in crates) {
                 if (crates.hasOwnProperty(crate)) {
                     crates_text.push(crate);