Files
chrmc40 8e3dceae99 ComfyUI-PromptChain
A prompt-authoring and image-iteration suite for ComfyUI.
2026-06-17 19:35:25 -07:00

20 lines
810 B
JavaScript

// Sizing — enforces minimum node width in Vue 2.0 mode.
// The 2.0 resize handler reads inline min-width from the node element.
// This must be re-applied after graph load and mode switches because
// Vue destroys/recreates DOM elements, losing inline styles.
import { MIN_NODE_SIZE, isVueMode } from "./config.js";
export function applyVueMinWidthAll(graph) {
if (!isVueMode() || !graph?._nodes) return;
for (const node of graph._nodes) {
if (!node._pcrHasMinSize) continue;
const element = document.querySelector(`[data-node-id="${node.id}"]`);
if (!element) continue;
const current = element.style.getPropertyValue("min-width");
if (!current || parseFloat(current) < MIN_NODE_SIZE.vue[0]) {
element.style.setProperty("min-width", `${MIN_NODE_SIZE.vue[0]}px`);
}
}
}