prefill name

This commit is contained in:
inventivetalent
2018-10-26 18:02:14 +02:00
parent f935d5ffe3
commit 6e8fe7a2e0

View File

@@ -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);