mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
prefill name
This commit is contained in:
@@ -7271,12 +7271,15 @@ LGraphCanvas.prototype.processContextMenu = function( node, event )
|
||||
else if( v.content == "Rename Slot")
|
||||
{
|
||||
var info = v.slot;
|
||||
var slot_info = info.input ? node.getInputInfo( info.slot ) : node.getOutputInfo( info.slot );
|
||||
var dialog = that.createDialog( "<span class='name'>Name</span><input type='text'/><button>OK</button>" , options );
|
||||
var input = dialog.querySelector("input");
|
||||
if(input && slot_info){
|
||||
input.value = slot_info.label;
|
||||
}
|
||||
dialog.querySelector("button").addEventListener("click",function(e){
|
||||
if(input.value)
|
||||
{
|
||||
var slot_info = info.input ? node.getInputInfo( info.slot ) : node.getOutputInfo( info.slot );
|
||||
if( slot_info )
|
||||
slot_info.label = input.value;
|
||||
that.setDirty(true);
|
||||
|
||||
Reference in New Issue
Block a user