chore(client/ts): port spacer

This commit is contained in:
Elian Doran 2025-01-04 21:59:35 +02:00
parent c2315a9341
commit fa6d229ecf
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

View File

@ -75,6 +75,7 @@ export type CommandMappings = {
searchString?: string;
ancestorNoteId?: string | null;
};
showLaunchBarSubtree: CommandData;
showOptions: CommandData & {
section: string;
};

View File

@ -6,6 +6,10 @@ import appContext from "../components/app_context.js";
const TPL = `<div class="spacer"></div>`;
export default class SpacerWidget extends BasicWidget {
private baseSize: number;
private growthFactor: number;
constructor(baseSize = 0, growthFactor = 1000) {
super();
@ -29,7 +33,9 @@ export default class SpacerWidget extends BasicWidget {
{title: t("spacer.configure_launchbar"), command: "showLaunchBarSubtree", uiIcon: "bx bx-sidebar"}
],
selectMenuItemHandler: ({command}) => {
appContext.triggerCommand(command);
if (command) {
appContext.triggerCommand(command);
}
}
});