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
1b556ea9
"web/vscode:/vscode.git/clone" did not exist on "195d7aec9f9c170ea94643ea71333ef8d1a6b84c"
Unverified
Commit
1b556ea9
authored
Apr 04, 2023
by
missionfloyd
Committed by
GitHub
Apr 04, 2023
Browse files
Add confirmation for clearing canvas
parent
1718730e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
web/scripts/ui.js
web/scripts/ui.js
+16
-3
No files found.
web/scripts/ui.js
View file @
1b556ea9
...
@@ -116,6 +116,13 @@ function dragElement(dragEl, settings) {
...
@@ -116,6 +116,13 @@ function dragElement(dragEl, settings) {
},
},
});
});
settings
.
addSetting
({
id
:
"
Comfy.ConfirmClear
"
,
name
:
"
Require confirmation when clearing workflow
"
,
type
:
"
boolean
"
,
defaultValue
:
false
,
});
function
dragMouseDown
(
e
)
{
function
dragMouseDown
(
e
)
{
e
=
e
||
window
.
event
;
e
=
e
||
window
.
event
;
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -510,10 +517,16 @@ export class ComfyUI {
...
@@ -510,10 +517,16 @@ export class ComfyUI {
$el
(
"
button
"
,
{
textContent
:
"
Load
"
,
onclick
:
()
=>
fileInput
.
click
()
}),
$el
(
"
button
"
,
{
textContent
:
"
Load
"
,
onclick
:
()
=>
fileInput
.
click
()
}),
$el
(
"
button
"
,
{
textContent
:
"
Refresh
"
,
onclick
:
()
=>
app
.
refreshComboInNodes
()
}),
$el
(
"
button
"
,
{
textContent
:
"
Refresh
"
,
onclick
:
()
=>
app
.
refreshComboInNodes
()
}),
$el
(
"
button
"
,
{
textContent
:
"
Clear
"
,
onclick
:
()
=>
{
$el
(
"
button
"
,
{
textContent
:
"
Clear
"
,
onclick
:
()
=>
{
if
(
localStorage
.
getItem
(
"
Comfy.Settings.Comfy.ConfirmClear
"
)
==
"
false
"
||
confirm
(
"
Clear workflow?
"
))
{
app
.
clean
();
app
.
clean
();
app
.
graph
.
clear
();
app
.
graph
.
clear
();
}
}}),
$el
(
"
button
"
,
{
textContent
:
"
Load Default
"
,
onclick
:
()
=>
{
if
(
localStorage
.
getItem
(
"
Comfy.Settings.Comfy.ConfirmClear
"
)
==
"
false
"
||
confirm
(
"
Load default workflow?
"
))
{
app
.
loadGraphData
()
}
}}),
}}),
$el
(
"
button
"
,
{
textContent
:
"
Load Default
"
,
onclick
:
()
=>
app
.
loadGraphData
()
}),
]);
]);
dragElement
(
this
.
menuContainer
,
this
.
settings
);
dragElement
(
this
.
menuContainer
,
this
.
settings
);
...
...
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