mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-04 20:21:31 +08:00
chore(client/ts): port left_pane_toggle
This commit is contained in:
parent
63ff94130f
commit
1480d79a75
@ -102,6 +102,8 @@ export type CommandMappings = {
|
|||||||
openNoteInNewTab: CommandData;
|
openNoteInNewTab: CommandData;
|
||||||
openNoteInNewSplit: CommandData;
|
openNoteInNewSplit: CommandData;
|
||||||
openNoteInNewWindow: CommandData;
|
openNoteInNewWindow: CommandData;
|
||||||
|
hideLeftPane: CommandData;
|
||||||
|
showLeftPane: CommandData;
|
||||||
|
|
||||||
openInTab: ContextMenuCommandData;
|
openInTab: ContextMenuCommandData;
|
||||||
openNoteInSplit: ContextMenuCommandData;
|
openNoteInSplit: ContextMenuCommandData;
|
||||||
|
@ -2,9 +2,11 @@ import options from "../../services/options.js";
|
|||||||
import splitService from "../../services/resizer.js";
|
import splitService from "../../services/resizer.js";
|
||||||
import CommandButtonWidget from "./command_button.js";
|
import CommandButtonWidget from "./command_button.js";
|
||||||
import { t } from "../../services/i18n.js";
|
import { t } from "../../services/i18n.js";
|
||||||
|
import type { EventData } from "../../components/app_context.js";
|
||||||
|
|
||||||
export default class LeftPaneToggleWidget extends CommandButtonWidget {
|
export default class LeftPaneToggleWidget extends CommandButtonWidget {
|
||||||
constructor(isHorizontalLayout) {
|
|
||||||
|
constructor(isHorizontalLayout: boolean) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.class(isHorizontalLayout ? "toggle-button" : "launcher-button");
|
this.class(isHorizontalLayout ? "toggle-button" : "launcher-button");
|
||||||
@ -32,7 +34,7 @@ export default class LeftPaneToggleWidget extends CommandButtonWidget {
|
|||||||
splitService.setupLeftPaneResizer(options.is("leftPaneVisible"));
|
splitService.setupLeftPaneResizer(options.is("leftPaneVisible"));
|
||||||
}
|
}
|
||||||
|
|
||||||
entitiesReloadedEvent({ loadResults }) {
|
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
||||||
if (loadResults.isOptionReloaded("leftPaneVisible")) {
|
if (loadResults.isOptionReloaded("leftPaneVisible")) {
|
||||||
this.refreshIcon();
|
this.refreshIcon();
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user