about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-11-27 19:04:58 +0100
committerbptato <nincsnevem662@gmail.com>2023-11-27 19:13:45 +0100
commit860893abaefef5f95537e584c9325e23ecb1b394 (patch)
tree1f07c7a74443010a5b9456f48ebb355396065212 /src/html
parent9fdea97d573962fe010c5e4d25c29ece7fee497d (diff)
downloadchawan-860893abaefef5f95537e584c9325e23ecb1b394.tar.gz
buffer: add DOMContentLoaded, misc event improvements
* Add DOMContentLoaded
* Re-use the same event object for all elements
* Reshape if an event was fired
* Reshape on setTimeout/setInterval fired
Diffstat (limited to 'src/html')
-rw-r--r--src/html/event.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/html/event.nim b/src/html/event.nim
index 46a576fb..6234f166 100644
--- a/src/html/event.nim
+++ b/src/html/event.nim
@@ -28,7 +28,7 @@ type
   Event* = ref object of RootObj
     ctype {.jsget: "type".}: string
     target* {.jsget.}: EventTarget
-    currentTarget {.jsget.}: EventTarget
+    currentTarget* {.jsget.}: EventTarget
     eventPhase {.jsget.}: uint16
     bubbles {.jsget.}: bool
     cancelable {.jsget.}: bool
@@ -93,11 +93,11 @@ proc newEvent(ctx: JSContext, ctype: string, eventInitDict = EventInit()):
   event.ctype = ctype
   return ok(event)
 
-proc newEvent*(ctx: JSContext, ctype: string, target, currentTarget: EventTarget): Event =
+proc newEvent*(ctx: JSContext, ctype: string, target: EventTarget): Event =
   return Event(
     ctype: ctype,
     target: target,
-    currentTarget: currentTarget
+    currentTarget: target
   )
 
 proc initialize(this: Event, ctype: string, bubbles, cancelable: bool) =