mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 13:26:01 +01:00
feat(react/floating_buttons): port execute note button
This commit is contained in:
@@ -61,6 +61,10 @@ const FLOATING_BUTTON_DEFINITIONS: FloatingButtonDefinition[] = [
|
||||
isEnabled: ({ note, noteContext }) =>
|
||||
note.type === "text" && noteContext?.viewScope?.viewMode === "default"
|
||||
&& !!noteContext.viewScope?.highlightsListTemporarilyHidden
|
||||
},
|
||||
{
|
||||
component: RunActiveNoteButton,
|
||||
isEnabled: ({ note }) => note.mime.startsWith("application/javascript") || note.mime === "text/x-sqlite;schema=trilium"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -213,6 +217,14 @@ function ShowHighlightsListWidgetButton({ noteContext }: FloatingButtonContext)
|
||||
/>
|
||||
}
|
||||
|
||||
function RunActiveNoteButton() {
|
||||
return <ActionButton
|
||||
icon="bx bx-play"
|
||||
text={t("code_buttons.execute_button_title")}
|
||||
triggerCommand="runActiveNote"
|
||||
/>
|
||||
}
|
||||
|
||||
/**
|
||||
* Show button that displays floating button after click on close button
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user