Skip to content

Build your personal knowledge base with Trilium Notes

feat(insert_note): display on two columns

Elian Doranfc4a595725cd
diff --git a/apps/client/src/menus/context_menu.ts b/apps/client/src/menus/context_menu.ts
index 788ece177e..aefe7bf302 100644
--- a/apps/client/src/menus/context_menu.ts
+++ b/apps/client/src/menus/context_menu.ts
@@ -35,6 +35,7 @@ export interface MenuCommandItem<T> {
shortcut?: string;
spellingSuggestion?: string;
checked?: boolean;
+ columns?: number;
}
export type MenuItem<T> = MenuCommandItem<T> | MenuSeparatorItem;
@@ -235,6 +236,9 @@ class ContextMenu {
$link.addClass("dropdown-toggle");
const $subMenu = $("<ul>").addClass("dropdown-menu");
+ if (!this.isMobile && item.columns) {
+ $subMenu.css("column-count", item.columns);
+ }
this.addItems($subMenu, item.items);
diff --git a/apps/client/src/menus/tree_context_menu.ts b/apps/client/src/menus/tree_context_menu.ts
index 887781d74b..4891111ea9 100644
--- a/apps/client/src/menus/tree_context_menu.ts
+++ b/apps/client/src/menus/tree_context_menu.ts
@@ -92,7 +92,8 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
command: "insertNoteAfter",
uiIcon: "bx bx-plus",
items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter") : null,
- enabled: insertNoteAfterEnabled && noSelectedNotes && notOptionsOrHelp
+ enabled: insertNoteAfterEnabled && noSelectedNotes && notOptionsOrHelp,
+ columns: 2
},
{
@@ -100,7 +101,8 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
command: "insertChildNote",
uiIcon: "bx bx-plus",
items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote") : null,
- enabled: notSearch && noSelectedNotes && notOptionsOrHelp
+ enabled: notSearch && noSelectedNotes && notOptionsOrHelp,
+ columns: 2
},
{ title: "----" },