diff --git a/apps/client/src/menus/context_menu.ts b/apps/client/src/menus/context_menu.ts index 983c0a48c..09b51694d 100644 --- a/apps/client/src/menus/context_menu.ts +++ b/apps/client/src/menus/context_menu.ts @@ -18,6 +18,11 @@ interface MenuSeparatorItem { title: "----"; } +interface MenuHeader { + title: string; + kind: "header"; +} + export interface MenuItemBadge { title: string; className?: string; @@ -45,7 +50,7 @@ export interface MenuCommandItem { columns?: number; } -export type MenuItem = MenuCommandItem | MenuSeparatorItem; +export type MenuItem = MenuCommandItem | MenuSeparatorItem | MenuHeader; export type MenuHandler = (item: MenuCommandItem, e: JQuery.MouseDownEvent) => void; export type ContextMenuEvent = PointerEvent | MouseEvent | JQuery.ContextMenuEvent; @@ -158,6 +163,8 @@ class ContextMenu { if (item.title === "----") { $parent.append($("
").addClass("dropdown-divider")); + } else if ("kind" in item && item.kind === "header") { + $parent.append($("
").addClass("dropdown-header").text(item.title)); } else { const $icon = $(""); diff --git a/apps/client/src/services/note_types.ts b/apps/client/src/services/note_types.ts index 64d31ad39..0dba6a0c0 100644 --- a/apps/client/src/services/note_types.ts +++ b/apps/client/src/services/note_types.ts @@ -157,9 +157,8 @@ async function getBuiltInTemplates(title: string | null, command: TreeCommandNam const items: MenuItem[] = []; if (title) { items.push({ - title: title, - enabled: false, - uiIcon: "bx bx-empty" + title: "title", + kind: "header" }); } else { items.push(SEPARATOR);