20 lines
480 B
JavaScript
20 lines
480 B
JavaScript
export function isVueNodes() {
|
|
return !!window.LiteGraph?.vueNodesMode;
|
|
}
|
|
|
|
export function applyAdaptiveCanvasOnly(widget) {
|
|
if (!widget || !widget.options) return widget;
|
|
try {
|
|
Object.defineProperty(widget.options, "canvasOnly", {
|
|
configurable: true,
|
|
enumerable: true,
|
|
get() {
|
|
return !window.LiteGraph?.vueNodesMode;
|
|
},
|
|
});
|
|
} catch (_error) {
|
|
widget.options.canvasOnly = !window.LiteGraph?.vueNodesMode;
|
|
}
|
|
return widget;
|
|
}
|