mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 14:42:11 -03:00
feat: add global context menu with actions and integration
This commit is contained in:
24
static/js/components/ContextMenu/GlobalContextMenu.js
Normal file
24
static/js/components/ContextMenu/GlobalContextMenu.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { BaseContextMenu } from './BaseContextMenu.js';
|
||||
|
||||
export class GlobalContextMenu extends BaseContextMenu {
|
||||
constructor() {
|
||||
super('globalContextMenu');
|
||||
}
|
||||
|
||||
showMenu(x, y) {
|
||||
super.showMenu(x, y, null);
|
||||
}
|
||||
|
||||
handleMenuAction(action, menuItem) {
|
||||
switch (action) {
|
||||
case 'placeholder-one':
|
||||
case 'placeholder-two':
|
||||
case 'placeholder-three':
|
||||
console.info(`Global context menu action triggered: ${action}`);
|
||||
break;
|
||||
default:
|
||||
console.warn(`Unhandled global context menu action: ${action}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,14 @@ export { LoraContextMenu } from './LoraContextMenu.js';
|
||||
export { RecipeContextMenu } from './RecipeContextMenu.js';
|
||||
export { CheckpointContextMenu } from './CheckpointContextMenu.js';
|
||||
export { EmbeddingContextMenu } from './EmbeddingContextMenu.js';
|
||||
export { GlobalContextMenu } from './GlobalContextMenu.js';
|
||||
export { ModelContextMenuMixin } from './ModelContextMenuMixin.js';
|
||||
|
||||
import { LoraContextMenu } from './LoraContextMenu.js';
|
||||
import { RecipeContextMenu } from './RecipeContextMenu.js';
|
||||
import { CheckpointContextMenu } from './CheckpointContextMenu.js';
|
||||
import { EmbeddingContextMenu } from './EmbeddingContextMenu.js';
|
||||
import { GlobalContextMenu } from './GlobalContextMenu.js';
|
||||
|
||||
// Factory method to create page-specific context menu instances
|
||||
export function createPageContextMenu(pageType) {
|
||||
@@ -23,4 +25,8 @@ export function createPageContextMenu(pageType) {
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function createGlobalContextMenu() {
|
||||
return new GlobalContextMenu();
|
||||
}
|
||||
Reference in New Issue
Block a user