chore(client/ts): port left_pane_toggle

This commit is contained in:
Elian Doran
2025-01-19 20:19:21 +02:00
parent 8e62c942ea
commit 3f7bda6289
2 changed files with 6 additions and 2 deletions

View File

@@ -104,6 +104,8 @@ export type CommandMappings = {
openNoteInNewTab: CommandData;
openNoteInNewSplit: CommandData;
openNoteInNewWindow: CommandData;
hideLeftPane: CommandData;
showLeftPane: CommandData;
openInTab: ContextMenuCommandData;
openNoteInSplit: ContextMenuCommandData;

View File

@@ -2,9 +2,11 @@ import options from "../../services/options.js";
import splitService from "../../services/resizer.js";
import CommandButtonWidget from "./command_button.js";
import { t } from "../../services/i18n.js";
import type { EventData } from "../../components/app_context.js";
export default class LeftPaneToggleWidget extends CommandButtonWidget {
constructor(isHorizontalLayout) {
constructor(isHorizontalLayout: boolean) {
super();
this.class(isHorizontalLayout ? "toggle-button" : "launcher-button");
@@ -32,7 +34,7 @@ export default class LeftPaneToggleWidget extends CommandButtonWidget {
splitService.setupLeftPaneResizer(options.is("leftPaneVisible"));
}
entitiesReloadedEvent({ loadResults }) {
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
if (loadResults.isOptionReloaded("leftPaneVisible")) {
this.refreshIcon();
}