Skip to content

Commit

Permalink
Rollup merge of #57614 - GuillaumeGomez:fix-crate-filtering, r=QuietM…
Browse files Browse the repository at this point in the history
…isdreavus

[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
  • Loading branch information
Centril authored Jan 15, 2019
2 parents a52ec3c + 0d695ff commit 9947b30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9947b30

Please sign in to comment.