(nodeType, nodeData)
| 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 | // --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected