Skip to content

Commit ccc5a85

Browse files
Rollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157
Rustdoc UI fixes The first commit fixes this bug (I couldn't figure out why we were setting the width manually and it works as expected without so...): ![Screenshot from 2021-01-31 12-58-46](https://user-images.githubusercontent.com/3050060/106384371-d56a7700-63ca-11eb-9e04-c06b40c2ab5e.png) The second commit fixes a small bug. On tablets or computer with very little width, the search section goes "over" the search input, making it impossible to click on the search input: ![Screenshot from 2021-01-31 13-22-37](https://user-images.githubusercontent.com/3050060/106384413-021e8e80-63cb-11eb-8321-391a1f8a4c7e.png) The third and last commit fixes two bugs that you can see in this screenshot: ![Screenshot from 2021-01-31 13-41-05](https://user-images.githubusercontent.com/3050060/106384424-0cd92380-63cb-11eb-82de-76218286c3fb.png) The wheel is going over the search input and the search tab is going under the search results text. The bug was fixed by simply switching to "mobile mode" at a bigger width: ![Screenshot from 2021-01-31 13-49-50](https://user-images.githubusercontent.com/3050060/106384466-4447d000-63cb-11eb-9330-a7cd29403905.png) cc ```@pickfire``` r? ```@Nemo157```
2 parents 82b00ec + be9b112 commit ccc5a85

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/librustdoc/html/static/main.js

-9
Original file line numberDiff line numberDiff line change
@@ -1695,15 +1695,6 @@ function defocusSearchBar() {
16951695

16961696
search.innerHTML = output;
16971697
showSearchResults(search);
1698-
var tds = search.getElementsByTagName("td");
1699-
var td_width = 0;
1700-
if (tds.length > 0) {
1701-
td_width = tds[0].offsetWidth;
1702-
}
1703-
var width = search.offsetWidth - 40 - td_width;
1704-
onEachLazy(search.getElementsByClassName("desc"), function(e) {
1705-
e.style.width = width + "px";
1706-
});
17071698
initSearchNav();
17081699
var elems = document.getElementById("titles").childNodes;
17091700
elems[0].onclick = function() { printTab(0); };

src/librustdoc/html/static/rustdoc.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ h4 > .notable-traits {
14251425
margin-left: 0px;
14261426
}
14271427

1428-
#main {
1428+
#main, #search {
14291429
margin-top: 45px;
14301430
padding: 0;
14311431
}
@@ -1579,7 +1579,7 @@ h4 > .notable-traits {
15791579
}
15801580
}
15811581

1582-
@media (max-width: 416px) {
1582+
@media (max-width: 464px) {
15831583
#titles, #titles > button {
15841584
height: 73px;
15851585
}

0 commit comments

Comments
 (0)