Improved search

This commit is contained in:
2018-04-02 16:07:52 +02:00
parent 487695cbce
commit b201649b4b
6 changed files with 48 additions and 32 deletions

View File

@ -4,4 +4,12 @@ export function* findAll(className: string): IterableIterator<HTMLElement> {
for(let i = 0; i < elements.length; ++i) {
yield elements[i] as HTMLElement
}
}
}
export function* findAllInside(className: string, root: HTMLElement): IterableIterator<HTMLElement> {
let elements = root.getElementsByClassName(className)
for(let i = 0; i < elements.length; ++i) {
yield elements[i] as HTMLElement
}
}