1
Fork 0

rustdoc: remove unused classes from sidebar

Since 98f05a0282 removed separate colors
from the currently-selected item, there's no need to have item classes on
sidebar links.
This commit is contained in:
Michael Howell 2022-10-11 08:50:41 -07:00
parent bb93450ec4
commit b5963f07e6
3 changed files with 67 additions and 69 deletions

View file

@ -451,7 +451,6 @@ function loadCss(cssFileName) {
const name = item[0];
const desc = item[1]; // can be null
let klass = shortty;
let path;
if (shortty === "mod") {
path = name + "/index.html";
@ -459,13 +458,12 @@ function loadCss(cssFileName) {
path = shortty + "." + name + ".html";
}
const current_page = document.location.href.split("/").pop();
if (path === current_page) {
klass += " current";
}
const link = document.createElement("a");
link.href = path;
link.title = desc;
link.className = klass;
if (path === current_page) {
link.className = "current";
}
link.textContent = name;
const li = document.createElement("li");
li.appendChild(link);