mirror of
https://github.com/zadam/trilium.git
synced 2025-11-28 19:44:24 +01:00
feat(dev): action to open print page easily
This commit is contained in:
parent
e4fae2d660
commit
abbb4e793f
@ -105,10 +105,24 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
|
||||
<FormDropdownDivider />
|
||||
|
||||
<CommandItem command="showAttachments" icon="bx bx-paperclip" disabled={isInOptionsOrHelp} text={t("note_actions.note_attachments")} />
|
||||
{glob.isDev && <DevelopmentActions note={note} />}
|
||||
</Dropdown>
|
||||
);
|
||||
}
|
||||
|
||||
function DevelopmentActions({ note }: { note: FNote }) {
|
||||
return (
|
||||
<>
|
||||
<FormDropdownDivider />
|
||||
<FormListItem disabled>Development-only Actions</FormListItem>
|
||||
<FormListItem
|
||||
icon="bx bx-printer"
|
||||
onClick={() => window.open(`/?print=#root/${note.noteId}`, "_blank")}
|
||||
>Open print page</FormListItem>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function CommandItem({ icon, text, title, command, disabled }: { icon: string, text: string, title?: string, command: CommandNames | (() => void), disabled?: boolean, destructive?: boolean }) {
|
||||
return <FormListItem
|
||||
icon={icon}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user