Anchors in web UI

This commit is contained in:
Philipp Heckel 2021-11-17 20:50:47 -05:00
parent ffe0c72a5a
commit ba2f6e08cd
3 changed files with 82 additions and 34 deletions

View file

@ -337,3 +337,12 @@ if (match) {
currentTopicUnsubscribeOnClose = true;
}
}
document.querySelectorAll('.anchor').forEach((el) => {
if (el.hasAttribute('id')) {
const id = el.getAttribute('id');
const anchor = document.createElement('a');
anchor.innerHTML = `<a href="#${id}" class="anchorLink">#</a>`;
el.appendChild(anchor);
}
});