Fix display of aliases in rustdoc search results
This commit is contained in:
parent
6b9236ed5a
commit
3dec71ea8f
@ -888,7 +888,7 @@ so that we can apply CSS-filters to change the arrow color in themes */
|
||||
justify-content: start;
|
||||
flex: 3;
|
||||
}
|
||||
.search-results .result-name span.alias {
|
||||
.search-results .result-name .alias {
|
||||
color: var(--search-results-alias-color);
|
||||
}
|
||||
.search-results .result-name .grey {
|
||||
@ -904,6 +904,9 @@ so that we can apply CSS-filters to change the arrow color in themes */
|
||||
max-width: calc(100% - var(--search-typename-width));
|
||||
display: inline-block;
|
||||
}
|
||||
.search-results .result-name .path > * {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.popover {
|
||||
position: absolute;
|
||||
|
@ -2108,30 +2108,23 @@ function initSearch(rawSearchIndex) {
|
||||
const resultName = document.createElement("div");
|
||||
resultName.className = "result-name";
|
||||
|
||||
if (item.is_alias) {
|
||||
const alias = document.createElement("span");
|
||||
alias.className = "alias";
|
||||
|
||||
const bold = document.createElement("b");
|
||||
bold.innerText = item.alias;
|
||||
alias.appendChild(bold);
|
||||
|
||||
alias.insertAdjacentHTML(
|
||||
"beforeend",
|
||||
"<i class=\"grey\"> - see </i>");
|
||||
|
||||
resultName.appendChild(alias);
|
||||
}
|
||||
|
||||
resultName.insertAdjacentHTML(
|
||||
"beforeend",
|
||||
`\
|
||||
<span class="typename">${typeName}</span>\
|
||||
<div class="path">\
|
||||
${item.displayPath}<span class="${type}">${name}</span>\
|
||||
</div>`);
|
||||
`<span class="typename">${typeName}</span>`);
|
||||
link.appendChild(resultName);
|
||||
|
||||
let alias = " ";
|
||||
if (item.is_alias) {
|
||||
alias = ` <div class="alias">\
|
||||
<b>${item.alias}</b><i class="grey"> - see </i>\
|
||||
</div>`;
|
||||
}
|
||||
resultName.insertAdjacentHTML(
|
||||
"beforeend",
|
||||
`<div class="path">${alias}\
|
||||
${item.displayPath}<span class="${type}">${name}</span>\
|
||||
</div>`);
|
||||
|
||||
const description = document.createElement("div");
|
||||
description.className = "desc";
|
||||
description.insertAdjacentHTML("beforeend", item.desc);
|
||||
|
Loading…
Reference in New Issue
Block a user