[Refactor] Prefer event listeners to callback props (#637)

N.B.: `onerror` replacement is not a `window` or `Element` instance.
This commit is contained in:
filtered
2025-02-28 01:50:39 +11:00
committed by GitHub
parent 97bf9de83a
commit be8dc6867e
4 changed files with 8 additions and 9 deletions

View File

@@ -2760,10 +2760,10 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
img.ready = false
const dirty = () => this.setDirtyCanvas(true)
img.onload = function (this: AsyncImageElement) {
img.addEventListener("load", function (this: AsyncImageElement) {
this.ready = true
dirty()
}
})
return img
}