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
019bd519
Commit
019bd519
authored
Mar 14, 2023
by
pythongosssss
Browse files
Add dragleave handler to remove stuck highlight
parent
f2a6cff4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
web/scripts/app.js
web/scripts/app.js
+9
-1
No files found.
web/scripts/app.js
View file @
019bd519
...
@@ -289,13 +289,21 @@ class ComfyApp {
...
@@ -289,13 +289,21 @@ class ComfyApp {
this
.
dragOverNode
=
null
;
this
.
dragOverNode
=
null
;
// Node handles file drop, we dont use the built in onDropFile handler as its buggy
// Node handles file drop, we dont use the built in onDropFile handler as its buggy
// If you drag multiple files it will call it multiple times with the same file
// If you drag multiple files it will call it multiple times with the same file
if
(
n
&&
n
.
onDragDrop
&&
await
n
.
onDragDrop
(
event
))
{
if
(
n
&&
n
.
onDragDrop
&&
(
await
n
.
onDragDrop
(
event
))
)
{
return
;
return
;
}
}
await
this
.
handleFile
(
event
.
dataTransfer
.
files
[
0
]);
await
this
.
handleFile
(
event
.
dataTransfer
.
files
[
0
]);
});
});
// Always clear over node on drag leave
this
.
canvasEl
.
addEventListener
(
"
dragleave
"
,
async
()
=>
{
if
(
this
.
dragOverNode
)
{
this
.
dragOverNode
=
null
;
this
.
graph
.
setDirtyCanvas
(
false
,
true
);
}
});
// Add handler for dropping onto a specific node
// Add handler for dropping onto a specific node
this
.
canvasEl
.
addEventListener
(
this
.
canvasEl
.
addEventListener
(
"
dragover
"
,
"
dragover
"
,
...
...
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