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 committed Jan 15, 2019
2 parents e116891 + 0d695ff commit 94b4ab5
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 94b4ab5

Please sign in to comment.