mirror of
https://github.com/zadam/trilium.git
synced 2025-12-20 14:24:27 +01:00
feat(breadcrumb): get link menu items
This commit is contained in:
parent
9d581347f1
commit
cb8e35c4dc
@ -154,16 +154,21 @@ function BreadcrumbItem({ index, notePath, noteContext, notePathLength }: { inde
|
|||||||
return <NoteLink
|
return <NoteLink
|
||||||
notePath={notePath}
|
notePath={notePath}
|
||||||
noContextMenu
|
noContextMenu
|
||||||
onContextMenu={(e) => {
|
onContextMenu={async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
const noteId = notePath.split("/").at(-1);
|
||||||
|
if (!noteId) return;
|
||||||
|
const note = await froca.getNote(noteId);
|
||||||
|
if (!note) return;
|
||||||
|
|
||||||
contextMenu.show({
|
contextMenu.show({
|
||||||
items: [
|
items: [
|
||||||
{
|
...link_context_menu.getItems(e),
|
||||||
title: "Foo"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
x: e.pageX,
|
x: e.pageX,
|
||||||
y: e.pageY
|
y: e.pageY,
|
||||||
|
selectMenuItemHandler: ({ command }) => link_context_menu.handleLinkContextMenuItem(command, e, note.noteId),
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>;
|
/>;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user