Use getElementsByClassName

This commit is contained in:
Eduard Urbach 2017-06-26 12:32:07 +02:00
parent 70c15f0f93
commit d197fb30fb
2 changed files with 3 additions and 2 deletions

View File

@ -129,7 +129,7 @@ export class AnimeNotifier {
}
unmountMountables() {
for(let element of findAll("mounted")) {
for(let element of findAll("mountable")) {
element.classList.remove("mounted")
}
}

View File

@ -1,7 +1,8 @@
export function* findAll(className: string) {
// getElementsByClassName failed for some reason.
// TODO: Test getElementsByClassName again.
let elements = document.querySelectorAll("." + className)
// let elements = document.querySelectorAll("." + className)
let elements = document.getElementsByClassName(className)
for(let i = 0; i < elements.length; ++i) {
yield elements[i] as HTMLElement