Skip to content

Commit de3a291

Browse files
Speedup search loading when search url is received
1 parent f28df20 commit de3a291

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/librustdoc/html/static/main.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@
119119
map(function(s) {
120120
var pair = s.split("=");
121121
params[decodeURIComponent(pair[0])] =
122-
typeof pair[1] === "undefined" ?
123-
null : decodeURIComponent(pair[1]);
122+
typeof pair[1] === "undefined" ? null : decodeURIComponent(pair[1]);
124123
});
125124
return params;
126125
}
@@ -1756,6 +1755,14 @@
17561755
}
17571756
};
17581757
}
1758+
1759+
var params = getQueryStringParams();
1760+
if (params && params.search) {
1761+
addClass(document.getElementById("main"), "hidden");
1762+
var search = document.getElementById("search");
1763+
removeClass(search, "hidden");
1764+
search.innerHTML = '<h3 style="text-align: center;">Loading search results...</h3>';
1765+
}
17591766
}());
17601767

17611768
// Sets the focus on the search bar at the top of the page

0 commit comments

Comments
 (0)