mirror of
https://github.com/zadam/trilium.git
synced 2026-02-20 04:34:38 +01:00
client/list view: extract event handler
This commit is contained in:
parent
7e6daf5b36
commit
483c57029a
@ -19,6 +19,7 @@ import { JSX } from "preact/jsx-runtime";
|
||||
import { clsx } from "clsx";
|
||||
import ActionButton from "../../react/ActionButton";
|
||||
import linkContextMenuService from "../../../menus/link_context_menu";
|
||||
import { TargetedMouseEvent } from "preact";
|
||||
|
||||
export function ListView({ note, noteIds: unfilteredNoteIds, highlightedTokens }: ViewModeProps<{}>) {
|
||||
const expandDepth = useExpansionDepth(note);
|
||||
@ -140,7 +141,7 @@ function ListNoteCard({ note, parentNote, highlightedTokens, currentLevel, expan
|
||||
<NoteAttributes note={note} />
|
||||
<ActionButton className="nested-note-list-item-menu"
|
||||
icon="bx bx-dots-vertical-rounded" text=""
|
||||
onClick={(e) => {linkContextMenuService.openContextMenu(notePath, e); e.stopPropagation()}}
|
||||
onClick={(e) => openNoteMenu(notePath, e)}
|
||||
/>
|
||||
</h5>
|
||||
</CardSection>
|
||||
@ -274,3 +275,8 @@ function useExpansionDepth(note: FNote) {
|
||||
return parseInt(expandDepth, 10);
|
||||
|
||||
}
|
||||
|
||||
function openNoteMenu(notePath, e: TargetedMouseEvent<HTMLElement>) {
|
||||
linkContextMenuService.openContextMenu(notePath, e);
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user