Skip to content

Commit c17ab37

Browse files
authored
Rollup merge of rust-lang#49405 - GuillaumeGomez:search-appearance, r=QuietMisdreavus
Fix search appearance Fixes rust-lang#49377. r? @QuietMisdreavus And a screenshot: <img width="1016" alt="screen shot 2018-03-27 at 10 33 01" src="https://user-images.githubusercontent.com/3050060/37956373-7b522852-31ab-11e8-8915-7e20064b5edd.png">
2 parents 010fb40 + 96ef2f8 commit c17ab37

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/librustdoc/html/static/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,10 @@
11711171
return h1.innerHTML;
11721172
}
11731173

1174+
function pathSplitter(path) {
1175+
return '<span>' + path.replace(/::/g, '::</span><span>');
1176+
}
1177+
11741178
function addTab(array, query, display) {
11751179
var extraStyle = '';
11761180
if (display === false) {
@@ -1225,7 +1229,7 @@
12251229

12261230
output += '<tr class="' + type + ' result"><td>' +
12271231
'<a href="' + href + '">' +
1228-
displayPath + '<span class="' + type + '">' +
1232+
pathSplitter(displayPath) + '<span class="' + type + '">' +
12291233
name + '</span></a></td><td>' +
12301234
'<a href="' + href + '">' +
12311235
'<span class="desc">' + escape(item.desc) +

src/librustdoc/html/static/rustdoc.css

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ nav.sub {
296296
overflow: auto;
297297
}
298298

299+
#results > table {
300+
width: 100%;
301+
table-layout: fixed;
302+
}
303+
299304
.content pre.line-numbers {
300305
float: left;
301306
border: none;
@@ -577,8 +582,16 @@ a {
577582
display: block;
578583
}
579584

580-
.content .search-results td:first-child { padding-right: 0; }
581-
.content .search-results td:first-child a { padding-right: 10px; }
585+
.content .search-results td:first-child {
586+
padding-right: 0;
587+
width: 75%;
588+
}
589+
.content .search-results td:first-child a {
590+
padding-right: 10px;
591+
}
592+
.content .search-results td:first-child a span {
593+
float: left;
594+
}
582595

583596
tr.result span.primitive::after {
584597
content: ' (primitive type)';

0 commit comments

Comments
 (0)