From d197fb30fba44304671a67d6e411037dba7ca49a Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 26 Jun 2017 12:32:07 +0200 Subject: [PATCH] Use getElementsByClassName --- scripts/AnimeNotifier.ts | 2 +- scripts/utils.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/AnimeNotifier.ts b/scripts/AnimeNotifier.ts index f9999ad3..ea3d433e 100644 --- a/scripts/AnimeNotifier.ts +++ b/scripts/AnimeNotifier.ts @@ -129,7 +129,7 @@ export class AnimeNotifier { } unmountMountables() { - for(let element of findAll("mounted")) { + for(let element of findAll("mountable")) { element.classList.remove("mounted") } } diff --git a/scripts/utils.ts b/scripts/utils.ts index 7d1ab232..b97017d3 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -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