From 860893abaefef5f95537e584c9325e23ecb1b394 Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 27 Nov 2023 19:04:58 +0100 Subject: 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 --- src/html/event.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/html') 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) = -- cgit 1.4.1-2-gfad0