Skip to content

Commit

Permalink
fix tag.nim
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethosa committed May 19, 2024
1 parent 3c6ac3f commit b3b56b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/happyx/spa/tag.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
}
}
Expand All @@ -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;
};
""".}
Expand Down

0 comments on commit b3b56b9

Please sign in to comment.