mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-02 03:30:04 +00:00
[Refactor] Prefer event listeners to callback props (#637)
N.B.: `onerror` replacement is not a `window` or `Element` instance.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user