mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
toggling the left pane will toggle the focus between tree and detail, #3563
This commit is contained in:
parent
68a03211ce
commit
2e181d0fb1
@ -1,5 +1,6 @@
|
|||||||
import options from "../../services/options.js";
|
import options from "../../services/options.js";
|
||||||
import FlexContainer from "./flex_container.js";
|
import FlexContainer from "./flex_container.js";
|
||||||
|
import appContext from "../../components/app_context.js";
|
||||||
|
|
||||||
export default class LeftPaneContainer extends FlexContainer {
|
export default class LeftPaneContainer extends FlexContainer {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -16,7 +17,15 @@ export default class LeftPaneContainer extends FlexContainer {
|
|||||||
|
|
||||||
entitiesReloadedEvent({loadResults}) {
|
entitiesReloadedEvent({loadResults}) {
|
||||||
if (loadResults.isOptionReloaded("leftPaneVisible")) {
|
if (loadResults.isOptionReloaded("leftPaneVisible")) {
|
||||||
this.toggleInt(this.isEnabled());
|
const visible = this.isEnabled();
|
||||||
|
this.toggleInt(visible);
|
||||||
|
|
||||||
|
if (visible) {
|
||||||
|
this.triggerEvent('focusTree');
|
||||||
|
} else {
|
||||||
|
const activeNoteContext = appContext.tabManager.getActiveContext();
|
||||||
|
this.triggerEvent('focusOnDetail', {ntxId: activeNoteContext.ntxId});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -887,6 +887,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async focusTreeEvent() {
|
||||||
|
this.tree.$container.focus();
|
||||||
|
this.tree.setFocus(true);
|
||||||
|
}
|
||||||
|
|
||||||
/** @returns {FancytreeNode} */
|
/** @returns {FancytreeNode} */
|
||||||
async getNodeFromPath(notePath, expand = false, logErrors = true) {
|
async getNodeFromPath(notePath, expand = false, logErrors = true) {
|
||||||
utils.assertArguments(notePath);
|
utils.assertArguments(notePath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user