mirror of
https://github.com/zadam/trilium.git
synced 2025-12-21 07:39:55 +01:00
feat(dev): action to open print page easily
This commit is contained in:
@@ -105,10 +105,24 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
|
|||||||
<FormDropdownDivider />
|
<FormDropdownDivider />
|
||||||
|
|
||||||
<CommandItem command="showAttachments" icon="bx bx-paperclip" disabled={isInOptionsOrHelp} text={t("note_actions.note_attachments")} />
|
<CommandItem command="showAttachments" icon="bx bx-paperclip" disabled={isInOptionsOrHelp} text={t("note_actions.note_attachments")} />
|
||||||
|
{glob.isDev && <DevelopmentActions note={note} />}
|
||||||
</Dropdown>
|
</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 }) {
|
function CommandItem({ icon, text, title, command, disabled }: { icon: string, text: string, title?: string, command: CommandNames | (() => void), disabled?: boolean, destructive?: boolean }) {
|
||||||
return <FormListItem
|
return <FormListItem
|
||||||
icon={icon}
|
icon={icon}
|
||||||
|
|||||||
Reference in New Issue
Block a user