From 0a93cb36be52c1f7fd43e78ab8689b2ee45c695f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 31 Jan 2021 13:13:52 +0100 Subject: [PATCH 1/3] Remove unneeded explicit width from search results --- src/librustdoc/html/static/main.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 53f0831852456..45ab76f1f9f99 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1688,15 +1688,6 @@ function defocusSearchBar() { search.innerHTML = output; showSearchResults(search); - var tds = search.getElementsByTagName("td"); - var td_width = 0; - if (tds.length > 0) { - td_width = tds[0].offsetWidth; - } - var width = search.offsetWidth - 40 - td_width; - onEachLazy(search.getElementsByClassName("desc"), function(e) { - e.style.width = width + "px"; - }); initSearchNav(); var elems = document.getElementById("titles").childNodes; elems[0].onclick = function() { printTab(0); }; From 07f5ca7e5383a6cc2218da4d68897b60b880c475 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 31 Jan 2021 13:34:32 +0100 Subject: [PATCH 2/3] Prevent search section to go over search input --- src/librustdoc/html/static/rustdoc.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 8dad26dced956..a7dd09ae4687f 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -1424,7 +1424,7 @@ h4 > .notable-traits { margin-left: 0px; } - #main { + #main, #search { margin-top: 45px; padding: 0; } From be9b112a5a1b6cb4eec2bf3feed73516b70825b5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 31 Jan 2021 13:42:16 +0100 Subject: [PATCH 3/3] Improve resize handling --- src/librustdoc/html/static/rustdoc.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index a7dd09ae4687f..a437d29d904f1 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -1578,7 +1578,7 @@ h4 > .notable-traits { } } -@media (max-width: 416px) { +@media (max-width: 464px) { #titles, #titles > button { height: 73px; }