mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
feat: clean up eventmanager class
This commit is contained in:
@@ -136,11 +136,10 @@ class EventManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async checkElement(element: Element): Promise<void> {
|
private async checkElement(element: Element): Promise<void> {
|
||||||
if (element.classList.contains('code')) console.log('Code Detected!');
|
|
||||||
for (const [event, listeners] of this.listeners.entries()) {
|
for (const [event, listeners] of this.listeners.entries()) {
|
||||||
for (const { id, options, callback } of listeners) {
|
for (const { id, options, callback } of listeners) {
|
||||||
if (this.matchesOptions(element, options)) {
|
if (this.matchesOptions(element, options)) {
|
||||||
await callback(element);
|
callback(element);
|
||||||
if (options.once) {
|
if (options.once) {
|
||||||
this.unregisterById(event, id);
|
this.unregisterById(event, id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user