refactor: remove unused height properties and simplify widget height handling in various components, fixes #284

This commit is contained in:
Will Miao
2025-08-07 16:49:39 +08:00
parent 854e467c12
commit 6678ec8a60
6 changed files with 5 additions and 51 deletions

View File

@@ -5,9 +5,6 @@ export function addJsonDisplayWidget(node, name, opts) {
// Set initial height
const defaultHeight = 200;
container.style.setProperty('--comfy-widget-min-height', `${defaultHeight}px`);
container.style.setProperty('--comfy-widget-max-height', `${defaultHeight * 2}px`);
container.style.setProperty('--comfy-widget-height', `${defaultHeight}px`);
Object.assign(container.style, {
display: "block",
@@ -113,16 +110,6 @@ export function addJsonDisplayWidget(node, name, opts) {
widgetValue = v;
displayJson(widgetValue, widget);
},
getMinHeight: function() {
return parseInt(container.style.getPropertyValue('--comfy-widget-min-height')) || defaultHeight;
},
getMaxHeight: function() {
return parseInt(container.style.getPropertyValue('--comfy-widget-max-height')) || defaultHeight * 2;
},
getHeight: function() {
// Return actual container height to reduce the gap
return parseInt(container.style.getPropertyValue('--comfy-widget-height')) || defaultHeight;
},
hideOnZoom: true
});