MCPcopy
hub / github.com/Lightricks/ComfyUI-LTXVideo / beforeRegisterNodeDef

Function beforeRegisterNodeDef

web/js/sparse_track_editor.js:118–148  ·  view source on GitHub ↗
(nodeType, nodeData)

Source from the content-addressed store, hash-verified

116 },
117
118 async beforeRegisterNodeDef(nodeType, nodeData) {
119 if (nodeData?.name !== "LTXVSparseTrackEditor") return;
120
121 const origExecuted = nodeType.prototype.onExecuted;
122 nodeType.prototype.onExecuted = function (data) {
123 origExecuted?.apply(this, arguments);
124 if (data?.bg_image?.[0]) {
125 loadBgImage(this, data.bg_image[0]);
126 }
127 };
128
129 const origConfigure = nodeType.prototype.onConfigure;
130 nodeType.prototype.onConfigure = function (info) {
131 origConfigure?.apply(this, arguments);
132 if (this._ed) {
133 reloadState(this);
134 }
135 };
136
137 const origRemoved = nodeType.prototype.onRemoved;
138 nodeType.prototype.onRemoved = function () {
139 origRemoved?.apply(this, arguments);
140 if (this._ed) {
141 cancelAnimationFrame(this._ed.rafId);
142 if (this._ed._docClickHandler) {
143 document.removeEventListener("click", this._ed._docClickHandler);
144 }
145 this._ed = null;
146 }
147 };
148 },
149});
150
151// ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

loadBgImageFunction · 0.85
reloadStateFunction · 0.85
applyMethod · 0.45

Tested by

no test coverage detected