Skip to content

Commit d377447

Browse files
committed
move crate picker into new search panel
1 parent 8f55b2e commit d377447

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/librustdoc/html/static/js/search.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -2815,15 +2815,7 @@ ${item.displayPath}<span class="${type}">${name}</span>\
28152815
}
28162816
}
28172817

2818-
let crates = "";
2819-
if (rawSearchIndex.size > 1) {
2820-
crates = " in&nbsp;<div id=\"crate-search-div\"><select id=\"crate-search\">" +
2821-
"<option value=\"all crates\">all crates</option>";
2822-
for (const c of rawSearchIndex.keys()) {
2823-
crates += `<option value="${c}" ${c === filterCrates && "selected"}>${c}</option>`;
2824-
}
2825-
crates += "</select></div>";
2826-
}
2818+
let crates = "";
28272819

28282820
let output = `<h1 class="search-results-title">Results${crates}</h1>`;
28292821
if (results.query.error !== null) {
@@ -3885,6 +3877,19 @@ ${item.displayPath}<span class="${type}">${name}</span>\
38853877
exports.execQuery = execQuery;
38863878
exports.parseQuery = parseQuery;
38873879
}
3880+
3881+
3882+
console.log(rawSearchIndex);
3883+
let crates = "";
3884+
if (rawSearchIndex.size > 1) {
3885+
crates = "<div id=\"crate-search-div\"><select id=\"crate-search\">" +
3886+
"<option value=\"all crates\" selected>all crates</option>";
3887+
for (const c of rawSearchIndex.keys()) {
3888+
crates += `<option value="${c}">${c}</option>`;
3889+
}
3890+
crates += "</select></div>";
3891+
}
3892+
document.getElementById("search-focus-panel").innerHTML = crates;
38883893
}
38893894

38903895
if (typeof window !== "undefined") {

0 commit comments

Comments
 (0)