Skip to content

Build your personal knowledge base with Trilium Notes

feat(zen): toggle body class for zen

Elian Doran5c81627112f4
diff --git a/src/public/app/components/app_context.ts b/src/public/app/components/app_context.ts
index 63e3144c2f..d6c7b8cc16 100644
--- a/src/public/app/components/app_context.ts
+++ b/src/public/app/components/app_context.ts
@@ -223,6 +223,8 @@ export type CommandMappings = {
// Geomap
deleteFromMap: { noteId: string },
openGeoLocation: { noteId: string, event: JQuery.MouseDownEvent }
+
+ toggleZenMode: CommandData;
};
type EventMappings = {
diff --git a/src/public/app/components/root_command_executor.ts b/src/public/app/components/root_command_executor.ts
index d93143a5f9..5f15ebe526 100644
--- a/src/public/app/components/root_command_executor.ts
+++ b/src/public/app/components/root_command_executor.ts
@@ -178,6 +178,10 @@ export default class RootCommandExecutor extends Component {
for (const window of windows) window[action]();
}
+ toggleZenModeCommand() {
+ $("body").toggleClass("zen");
+ }
+
firstTabCommand() {
this.#goToTab(1);
}