mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-28 09:37:04 +08:00
Allow setting Set/Get node position in node suggestion menu
This commit is contained in:
parent
c19ad34916
commit
51e792ccdf
@ -49,7 +49,7 @@ app.registerExtension({
|
|||||||
},
|
},
|
||||||
async setup(app) {
|
async setup(app) {
|
||||||
const onChange = (value) => {
|
const onChange = (value) => {
|
||||||
if (value) {
|
if (value!="disabled") {
|
||||||
const valuesToAddToIn = ["GetNode"];
|
const valuesToAddToIn = ["GetNode"];
|
||||||
const valuesToAddToOut = ["SetNode"];
|
const valuesToAddToOut = ["SetNode"];
|
||||||
|
|
||||||
@ -59,7 +59,11 @@ app.registerExtension({
|
|||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
arr.splice(idx, 1);
|
arr.splice(idx, 1);
|
||||||
}
|
}
|
||||||
arr.unshift(valueToAdd);
|
if (value === "top") {
|
||||||
|
arr.unshift(valueToAdd);
|
||||||
|
} else {
|
||||||
|
arr.push(valueToAdd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +73,11 @@ app.registerExtension({
|
|||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
arr.splice(idx, 1);
|
arr.splice(idx, 1);
|
||||||
}
|
}
|
||||||
arr.unshift(valueToAdd);
|
if (value === "top") {
|
||||||
|
arr.unshift(valueToAdd);
|
||||||
|
} else {
|
||||||
|
arr.push(valueToAdd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,9 +85,11 @@ app.registerExtension({
|
|||||||
|
|
||||||
app.ui.settings.addSetting({
|
app.ui.settings.addSetting({
|
||||||
id: "KJNodes.SetGetMenu",
|
id: "KJNodes.SetGetMenu",
|
||||||
name: "KJNodes: Make Set/Get -nodes defaults (turn off and reload to disable)",
|
name: "KJNodes: Make Set/Get -nodes defaults",
|
||||||
defaultValue: false,
|
tooltip: 'Adds Set/Get nodes to the top or bottom of the list of available node suggestions. Disabling requires a browser reload.',
|
||||||
type: "boolean",
|
options: ['disabled', 'top', 'bottom'],
|
||||||
|
defaultValue: 'disabled',
|
||||||
|
type: "combo",
|
||||||
onChange: onChange,
|
onChange: onChange,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user