From b3b56b96fc79d283409f1a6e3e3762d31f9dc481 Mon Sep 17 00:00:00 2001 From: Ethosa Date: Sun, 19 May 2024 13:18:49 +0700 Subject: [PATCH] fix tag.nim --- src/happyx/spa/tag.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/happyx/spa/tag.nim b/src/happyx/spa/tag.nim index 936058b0..e703778b 100644 --- a/src/happyx/spa/tag.nim +++ b/src/happyx/spa/tag.nim @@ -99,7 +99,7 @@ when defined(js): return this._eventListeners; } - const cloneEvents = (source, element, deep) => { + globalThis.cloneEvents = (source, element, deep) => { for (const args of source.getEventListeners()) Element.prototype.addEventListener.apply(element, args) @@ -108,7 +108,7 @@ when defined(js): const sourceNode = source.childNodes[i]; const targetNode = element.childNodes[i]; if (sourceNode instanceof Element && targetNode instanceof Element) { - cloneEvents(sourceNode, targetNode, deep); + globalThis.cloneEvents(sourceNode, targetNode, deep); } } } @@ -135,7 +135,7 @@ when defined(js): this._eventListeners = []; const clonedNode = globalThis.originCloneNode.apply(this, arguments); if (clonedNode instanceof Element) - cloneEvents(this, clonedNode, deep); + globalThis.cloneEvents(this, clonedNode, deep); return clonedNode; }; """.}