Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix search appearance #49405

Merged
merged 1 commit into from
Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,10 @@
return h1.innerHTML;
}

function pathSplitter(path) {
return '<span>' + path.replace(/::/g, '::</span><span>');
}

function addTab(array, query, display) {
var extraStyle = '';
if (display === false) {
Expand Down Expand Up @@ -1225,7 +1229,7 @@

output += '<tr class="' + type + ' result"><td>' +
'<a href="' + href + '">' +
displayPath + '<span class="' + type + '">' +
pathSplitter(displayPath) + '<span class="' + type + '">' +
name + '</span></a></td><td>' +
'<a href="' + href + '">' +
'<span class="desc">' + escape(item.desc) +
Expand Down
17 changes: 15 additions & 2 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ nav.sub {
overflow: auto;
}

#results > table {
width: 100%;
table-layout: fixed;
}

.content pre.line-numbers {
float: left;
border: none;
Expand Down Expand Up @@ -577,8 +582,16 @@ a {
display: block;
}

.content .search-results td:first-child { padding-right: 0; }
.content .search-results td:first-child a { padding-right: 10px; }
.content .search-results td:first-child {
padding-right: 0;
width: 75%;
}
.content .search-results td:first-child a {
padding-right: 10px;
}
.content .search-results td:first-child a span {
float: left;
}

tr.result span.primitive::after {
content: ' (primitive type)';
Expand Down