2021-03-28 22:24:24 +02:00
|
|
|
import options from "../../services/options.js";
|
2020-02-07 22:19:35 +01:00
|
|
|
import FlexContainer from "./flex_container.js";
|
2023-01-31 22:35:01 +01:00
|
|
|
import appContext from "../../components/app_context.js";
|
2020-02-04 22:46:17 +01:00
|
|
|
|
2021-06-03 22:23:11 +02:00
|
|
|
export default class LeftPaneContainer extends FlexContainer {
|
2021-05-22 21:35:25 +02:00
|
|
|
constructor() {
|
2025-01-09 18:07:02 +02:00
|
|
|
super("column");
|
2020-02-04 22:46:17 +01:00
|
|
|
|
2025-01-09 18:07:02 +02:00
|
|
|
this.id("left-pane");
|
|
|
|
this.css("height", "100%");
|
2021-06-13 22:55:31 +02:00
|
|
|
this.collapsible();
|
2020-02-04 22:46:17 +01:00
|
|
|
}
|
|
|
|
|
2020-02-08 21:54:39 +01:00
|
|
|
isEnabled() {
|
2025-01-09 18:07:02 +02:00
|
|
|
return super.isEnabled() && options.is("leftPaneVisible");
|
2020-02-08 21:54:39 +01:00
|
|
|
}
|
|
|
|
|
2025-01-09 18:07:02 +02:00
|
|
|
entitiesReloadedEvent({ loadResults }) {
|
2021-05-22 21:35:25 +02:00
|
|
|
if (loadResults.isOptionReloaded("leftPaneVisible")) {
|
2023-01-31 22:35:01 +01:00
|
|
|
const visible = this.isEnabled();
|
|
|
|
this.toggleInt(visible);
|
|
|
|
|
|
|
|
if (visible) {
|
2025-01-09 18:07:02 +02:00
|
|
|
this.triggerEvent("focusTree");
|
2023-01-31 22:35:01 +01:00
|
|
|
} else {
|
|
|
|
const activeNoteContext = appContext.tabManager.getActiveContext();
|
2025-01-09 18:07:02 +02:00
|
|
|
this.triggerEvent("focusOnDetail", { ntxId: activeNoteContext.ntxId });
|
2023-01-31 22:35:01 +01:00
|
|
|
}
|
2020-02-04 22:46:17 +01:00
|
|
|
}
|
|
|
|
}
|
2021-03-28 22:24:24 +02:00
|
|
|
}
|