mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
Rollup merge of #85509 - GuillaumeGomez:search-null-title, r=jsha
Prevent tab title to "null" if the URL is a search one
When we arrive on page with a search parameter in the URL, until the results are displayed, the page title is "null". It's because of this code:
```js
if (params.search !== undefined) {
var search = searchState.outputElement();
search.innerHTML = "<h3 style=\"text-align: center;\">" +
searchState.loadingText + "</h3>";
searchState.showResults(search);
loadSearch();
}
```
In `searchState.showResults`, we have this:
```js
document.title = searchState.title;
```
But since it's `null`, we set it as title. This PR fixes it.
r? `@jsha`
This commit is contained in:
@@ -161,7 +161,7 @@ function hideThemeButtonState() {
|
||||
outputElement: function() {
|
||||
return document.getElementById("search");
|
||||
},
|
||||
title: null,
|
||||
title: document.title,
|
||||
titleBeforeSearch: document.title,
|
||||
timeout: null,
|
||||
// On the search screen, so you remain on the last tab you opened.
|
||||
|
||||
Reference in New Issue
Block a user