Skip to content

Commit 68b5133

Browse files
committed
Reorder subgraph context menu items
- Follow-up on #4870 4870 is incomplete; the changes in this follow-up PR were what was tested, however the commit itself did not get pushed.
1 parent 71a4319 commit 68b5133

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib/litegraph/src/subgraph/SubgraphIONodeBase.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export abstract class SubgraphIONodeBase<
191191
* @param event The event that triggered the context menu.
192192
*/
193193
protected showSlotContextMenu(slot: TSlot, event: CanvasPointerEvent): void {
194-
const options: IContextMenuValue[] = this.#getSlotMenuOptions(slot)
194+
const options = this.#getSlotMenuOptions(slot)
195195
if (!(options.length > 0)) return
196196

197197
new LiteGraph.ContextMenu(options, {
@@ -208,8 +208,8 @@ export abstract class SubgraphIONodeBase<
208208
* @param slot The slot to get the context menu options for.
209209
* @returns The context menu options.
210210
*/
211-
#getSlotMenuOptions(slot: TSlot): IContextMenuValue[] {
212-
const options: IContextMenuValue[] = []
211+
#getSlotMenuOptions(slot: TSlot): (IContextMenuValue | null)[] {
212+
const options: (IContextMenuValue | null)[] = []
213213

214214
// Disconnect option if slot has connections
215215
if (slot !== this.emptySlot && slot.linkIds.length > 0) {
@@ -218,10 +218,10 @@ export abstract class SubgraphIONodeBase<
218218

219219
// Remove / rename slot option (except for the empty slot)
220220
if (slot !== this.emptySlot) {
221-
options.push(
222-
{ content: 'Remove Slot', value: 'remove' },
223-
{ content: 'Rename Slot', value: 'rename' }
224-
)
221+
options.push({ content: 'Rename Slot', value: 'rename' }, null, {
222+
content: 'Remove Slot',
223+
value: 'remove'
224+
})
225225
}
226226

227227
return options

0 commit comments

Comments
 (0)