mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-06 13:40:25 +00:00
add event handlers for single & double click on input/output
This commit is contained in:
@@ -3785,6 +3785,14 @@ LGraphCanvas.prototype.processMouseDown = function(e)
|
||||
this.connecting_pos = node.getConnectionPos(false,i);
|
||||
this.connecting_slot = i;
|
||||
|
||||
if (is_double_click) {
|
||||
if (node.onOutputDblClick)
|
||||
node.onOutputDblClick(i, e);
|
||||
} else {
|
||||
if (node.onOutputClick)
|
||||
node.onOutputClick(i, e);
|
||||
}
|
||||
|
||||
skip_action = true;
|
||||
break;
|
||||
}
|
||||
@@ -3798,6 +3806,14 @@ LGraphCanvas.prototype.processMouseDown = function(e)
|
||||
var link_pos = node.getConnectionPos( true, i );
|
||||
if( isInsideRectangle(e.canvasX, e.canvasY, link_pos[0] - 10, link_pos[1] - 5, 20,10) )
|
||||
{
|
||||
if (is_double_click) {
|
||||
if (node.onInputDblClick)
|
||||
node.onInputDblClick(i, e);
|
||||
} else {
|
||||
if (node.onInputClick)
|
||||
node.onInputClick(i, e);
|
||||
}
|
||||
|
||||
if(input.link !== null)
|
||||
{
|
||||
node.disconnectInput(i);
|
||||
|
||||
Reference in New Issue
Block a user