mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-23 15:59:47 +00:00
make removable slots only the ones created from editor
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
(function(global) {
|
||||
// *************************************************************
|
||||
// LiteGraph CLASS *******
|
||||
@@ -9148,6 +9149,7 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
var font_size =
|
||||
group.font_size || LiteGraph.DEFAULT_GROUP_FONT_SIZE;
|
||||
ctx.font = font_size + "px Arial";
|
||||
ctx.textAlign = "left";
|
||||
ctx.fillText(group.title, pos[0] + 4, pos[1] + font_size);
|
||||
}
|
||||
|
||||
@@ -9389,9 +9391,14 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
continue;
|
||||
}
|
||||
var label = entry[0];
|
||||
if (entry[2] && entry[2].label) {
|
||||
if(!entry[2])
|
||||
entry[2] = {};
|
||||
|
||||
if (entry[2].label) {
|
||||
label = entry[2].label;
|
||||
}
|
||||
|
||||
entry[2].removable = true;
|
||||
var data = { content: label, value: entry };
|
||||
if (entry[1] == LiteGraph.ACTION) {
|
||||
data.className = "event";
|
||||
@@ -9478,9 +9485,12 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
continue;
|
||||
} //skip the ones already on
|
||||
var label = entry[0];
|
||||
if (entry[2] && entry[2].label) {
|
||||
if(!entry[2])
|
||||
entry[2] = {};
|
||||
if (entry[2].label) {
|
||||
label = entry[2].label;
|
||||
}
|
||||
entry[2].removable = true;
|
||||
var data = { content: label, value: entry };
|
||||
if (entry[1] == LiteGraph.EVENT) {
|
||||
data.className = "event";
|
||||
@@ -11120,7 +11130,7 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
}
|
||||
var _slot = slot.input || slot.output;
|
||||
menu_info.push(
|
||||
_slot.locked
|
||||
_slot.locked || !_slot.removable
|
||||
? "Cannot remove"
|
||||
: { content: "Remove Slot", slot: slot }
|
||||
);
|
||||
@@ -12100,3 +12110,4 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
if (typeof exports != "undefined") {
|
||||
exports.LiteGraph = this.LiteGraph;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user