diff options
-rw-r--r-- | src/html/env.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/html/env.nim b/src/html/env.nim index 0543a60c..694b09cf 100644 --- a/src/html/env.nim +++ b/src/html/env.nim @@ -130,13 +130,14 @@ proc addScripting*(window: Window, selector: Selector[int]) = ) ) var global = JS_GetGlobalObject(ctx) - ctx.registerType(Window, asglobal = true) + ctx.addEventModule() + let eventTargetCID = ctx.getClass("EventTarget") + ctx.registerType(Window, asglobal = true, parent = eventTargetCID) ctx.setGlobal(global, window) JS_FreeValue(ctx, global) ctx.addDOMExceptionModule() ctx.addConsoleModule() ctx.addNavigatorModule() - ctx.addEventModule() ctx.addDOMModule() ctx.addURLModule() ctx.addHTMLModule() |