mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-14 15:24:34 +08:00
Merge pull request #417 from AustinMroz/main
Rework context menu options for getter nodes.
This commit is contained in:
commit
405c99ec16
@ -470,9 +470,8 @@ app.registerExtension({
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.goToSetter = function() {
|
this.goToSetter = function() {
|
||||||
const setter = this.findSetter(this.graph);
|
this.canvas.centerOnNode(this.currentSetter);
|
||||||
this.canvas.centerOnNode(setter);
|
this.canvas.selectNode(this.currentSetter, false);
|
||||||
this.canvas.selectNode(setter, false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// This node is purely frontend and does not impact the resulting prompt so should not be serialized
|
// This node is purely frontend and does not impact the resulting prompt so should not be serialized
|
||||||
@ -496,7 +495,8 @@ app.registerExtension({
|
|||||||
}
|
}
|
||||||
getExtraMenuOptions(_, options) {
|
getExtraMenuOptions(_, options) {
|
||||||
let menuEntry = this.drawConnection ? "Hide connections" : "Show connections";
|
let menuEntry = this.drawConnection ? "Hide connections" : "Show connections";
|
||||||
|
this.currentSetter = this.findSetter(this.graph)
|
||||||
|
if (!this.currentSetter) return
|
||||||
options.unshift(
|
options.unshift(
|
||||||
{
|
{
|
||||||
content: "Go to setter",
|
content: "Go to setter",
|
||||||
@ -507,12 +507,9 @@ app.registerExtension({
|
|||||||
{
|
{
|
||||||
content: menuEntry,
|
content: menuEntry,
|
||||||
callback: () => {
|
callback: () => {
|
||||||
this.currentSetter = this.findSetter(this.graph);
|
let linkType = (this.currentSetter.inputs[0].type);
|
||||||
if (this.currentSetter.length == 0) return;
|
|
||||||
let linkType = (this.currentSetter.inputs[0].type);
|
|
||||||
this.drawConnection = !this.drawConnection;
|
this.drawConnection = !this.drawConnection;
|
||||||
this.slotColor = this.canvas.default_connection_color_byType[linkType]
|
this.slotColor = this.canvas.default_connection_color_byType[linkType]
|
||||||
menuEntry = this.drawConnection ? "Hide connections" : "Show connections";
|
|
||||||
this.canvas.setDirty(true, true);
|
this.canvas.setDirty(true, true);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user