Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
1ca4802e
Commit
1ca4802e
authored
Nov 22, 2023
by
comfyanonymous
Browse files
Merge branch 'hide-if-collapsed' of
https://github.com/pythongosssss/ComfyUI
parents
c3ae99a7
ab7d4f78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
web/scripts/domWidget.js
web/scripts/domWidget.js
+10
-0
No files found.
web/scripts/domWidget.js
View file @
1ca4802e
...
@@ -234,6 +234,7 @@ LGraphNode.prototype.addDOMWidget = function (name, type, element, options) {
...
@@ -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) {
...
@@ -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();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment