Move item kind before the item name

This commit is contained in:
Guillaume Gomez 2023-05-18 16:16:13 +02:00
parent 7a09a688de
commit 8a35cc3ddc
6 changed files with 22 additions and 35 deletions

View file

@ -1866,7 +1866,7 @@ function initSearch(rawSearchIndex) {
const name = item.name;
const type = itemTypes[item.ty];
const longType = longItemTypes[item.ty];
let extra = longType.length !== 0 ? ` <i>(${longType})</i>` : "";
const typeName = longType.length !== 0 ? `${longType}` : "?";
length += 1;
@ -1878,7 +1878,6 @@ function initSearch(rawSearchIndex) {
resultName.className = "result-name";
if (item.is_alias) {
extra = "";
const alias = document.createElement("span");
alias.className = "alias";
@ -1892,9 +1891,15 @@ function initSearch(rawSearchIndex) {
resultName.appendChild(alias);
}
const typeDisplay = document.createElement("div");
typeDisplay.innerText = typeName;
typeDisplay.className = "type-kind";
link.appendChild(typeDisplay);
resultName.insertAdjacentHTML(
"beforeend",
item.displayPath + "<span class=\"" + type + "\">" + name + "</span>" + extra);
item.displayPath + "<span class=\"" + type + "\">" + name + "</span>");
link.appendChild(resultName);
const description = document.createElement("div");