mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 16:56:34 +01:00
feat(insert_note): display on two columns
This commit is contained in:
@@ -35,6 +35,7 @@ export interface MenuCommandItem<T> {
|
|||||||
shortcut?: string;
|
shortcut?: string;
|
||||||
spellingSuggestion?: string;
|
spellingSuggestion?: string;
|
||||||
checked?: boolean;
|
checked?: boolean;
|
||||||
|
columns?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MenuItem<T> = MenuCommandItem<T> | MenuSeparatorItem;
|
export type MenuItem<T> = MenuCommandItem<T> | MenuSeparatorItem;
|
||||||
@@ -235,6 +236,9 @@ class ContextMenu {
|
|||||||
$link.addClass("dropdown-toggle");
|
$link.addClass("dropdown-toggle");
|
||||||
|
|
||||||
const $subMenu = $("<ul>").addClass("dropdown-menu");
|
const $subMenu = $("<ul>").addClass("dropdown-menu");
|
||||||
|
if (!this.isMobile && item.columns) {
|
||||||
|
$subMenu.css("column-count", item.columns);
|
||||||
|
}
|
||||||
|
|
||||||
this.addItems($subMenu, item.items);
|
this.addItems($subMenu, item.items);
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
|
|||||||
command: "insertNoteAfter",
|
command: "insertNoteAfter",
|
||||||
uiIcon: "bx bx-plus",
|
uiIcon: "bx bx-plus",
|
||||||
items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter") : null,
|
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",
|
command: "insertChildNote",
|
||||||
uiIcon: "bx bx-plus",
|
uiIcon: "bx bx-plus",
|
||||||
items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote") : null,
|
items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote") : null,
|
||||||
enabled: notSearch && noSelectedNotes && notOptionsOrHelp
|
enabled: notSearch && noSelectedNotes && notOptionsOrHelp,
|
||||||
|
columns: 2
|
||||||
},
|
},
|
||||||
|
|
||||||
{ title: "----" },
|
{ title: "----" },
|
||||||
|
|||||||
Reference in New Issue
Block a user