mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-03-15 14:09:36 +00:00
Merge branch 'hide-if-collapsed' of https://github.com/pythongosssss/ComfyUI
This commit is contained in:
commit
1ca4802e8c
@ -234,6 +234,7 @@ LGraphNode.prototype.addDOMWidget = function (name, type, element, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const hidden =
|
const hidden =
|
||||||
|
node.flags?.collapsed ||
|
||||||
(!!options.hideOnZoom && app.canvas.ds.scale < 0.5) ||
|
(!!options.hideOnZoom && app.canvas.ds.scale < 0.5) ||
|
||||||
widget.computedHeight <= 0 ||
|
widget.computedHeight <= 0 ||
|
||||||
widget.type === "converted-widget";
|
widget.type === "converted-widget";
|
||||||
@ -291,6 +292,15 @@ LGraphNode.prototype.addDOMWidget = function (name, type, element, options) {
|
|||||||
this.addCustomWidget(widget);
|
this.addCustomWidget(widget);
|
||||||
elementWidgets.add(this);
|
elementWidgets.add(this);
|
||||||
|
|
||||||
|
const collapse = this.collapse;
|
||||||
|
this.collapse = function() {
|
||||||
|
collapse.apply(this, arguments);
|
||||||
|
if(this.flags?.collapsed) {
|
||||||
|
element.hidden = true;
|
||||||
|
element.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const onRemoved = this.onRemoved;
|
const onRemoved = this.onRemoved;
|
||||||
this.onRemoved = function () {
|
this.onRemoved = function () {
|
||||||
element.remove();
|
element.remove();
|
||||||
|
Loading…
Reference in New Issue
Block a user