mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
chore(nx): move all monorepo-style in subfolder for processing
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
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: boolean) {
|
||||
super();
|
||||
|
||||
this.class(isHorizontalLayout ? "toggle-button" : "launcher-button");
|
||||
|
||||
this.settings.icon = () => {
|
||||
if (options.get("layoutOrientation") === "horizontal") {
|
||||
return "bx-sidebar";
|
||||
}
|
||||
|
||||
return options.is("leftPaneVisible") ? "bx-chevrons-left" : "bx-chevrons-right";
|
||||
};
|
||||
|
||||
this.settings.title = () => (options.is("leftPaneVisible") ? t("left_pane_toggle.hide_panel") : t("left_pane_toggle.show_panel"));
|
||||
|
||||
this.settings.command = () => (options.is("leftPaneVisible") ? "hideLeftPane" : "showLeftPane");
|
||||
|
||||
if (isHorizontalLayout) {
|
||||
this.settings.titlePlacement = "bottom";
|
||||
}
|
||||
}
|
||||
|
||||
refreshIcon() {
|
||||
super.refreshIcon();
|
||||
|
||||
splitService.setupLeftPaneResizer(options.is("leftPaneVisible"));
|
||||
}
|
||||
|
||||
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
||||
if (loadResults.isOptionReloaded("leftPaneVisible")) {
|
||||
this.refreshIcon();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user