Fix display navbar with reports
All checks were successful
Continuous Deployment / lint (push) Successful in 26s
Continuous Deployment / deploy-chrome (push) Successful in 31s
Continuous Deployment / deploy-firefox (push) Successful in 2m43s

This commit is contained in:
2025-11-13 10:31:12 +01:00
parent 4f1d5442be
commit 4fe2922e5a
4 changed files with 12 additions and 4 deletions

View File

@@ -35,9 +35,13 @@ function shortcutElementReplace(elt, img, text) {
// If more than one hyperlink element found,
// then keep the last one but with href of the first one.
let aElements = elt.getElementsByTagName("a");
if (aElements.length > 1) {
let imgElements = elt.getElementsByTagName("img");
if (aElements.length > 1 || imgElements.length > 0) {
aElements[aElements.length - 1].classList.add("has_notif");
aElements[aElements.length - 1].setAttribute("href", aElements[0].getAttribute("href"));
for (let i = imgElements.length - 1; i >= 0; i --) {
imgElements[i].remove();
}
for (let i = aElements.length - 2; i >= 0; i --) {
aElements[i].remove();
}