mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-25 09:11:13 +01:00
Use classList instead of string manipulation
This commit is contained in:
parent
afdfe5fe71
commit
183d703fd3
@ -117,12 +117,7 @@ function isLocalFootnote(target) {
|
|||||||
function styleLocalFootnotes() {
|
function styleLocalFootnotes() {
|
||||||
for (elem of document.querySelectorAll("sup > a[href*='#fn'], sup > div > a[href*='#fn']")) {
|
for (elem of document.querySelectorAll("sup > a[href*='#fn'], sup > div > a[href*='#fn']")) {
|
||||||
if (isLocalFootnote(elem)) {
|
if (isLocalFootnote(elem)) {
|
||||||
if (elem.className.indexOf("footnote") === -1) {
|
elem.classList.add("footnote");
|
||||||
if (elem.className.length === 0)
|
|
||||||
elem.className = "footnote";
|
|
||||||
else
|
|
||||||
elem.className = elem.className + " " + "footnote";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user