diff --git a/db/demo.zip b/db/demo.zip
index 2d09590cf..0ad923a37 100644
Binary files a/db/demo.zip and b/db/demo.zip differ
diff --git a/src/public/app/components/tab_manager.js b/src/public/app/components/tab_manager.js
index 8f760cc95..2cbc3f0f4 100644
--- a/src/public/app/components/tab_manager.js
+++ b/src/public/app/components/tab_manager.js
@@ -79,11 +79,12 @@ export default class TabManager extends Component {
filteredTabs = filteredTabs.filter(tab => tab.active);
}
- if (filteredTabs.length === 0) {
- const [notePath] = treeService.getHashValueFromAddress();
+ // resolve before opened tabs can change this
+ const [notePathInUrl, ntxIdInUrl] = treeService.getHashValueFromAddress();
+ if (filteredTabs.length === 0) {
filteredTabs.push({
- notePath: notePath || 'root',
+ notePath: notePathInUrl || 'root',
active: true,
hoistedNoteId: glob.extraHoistedNoteId || 'root'
});
@@ -95,17 +96,14 @@ export default class TabManager extends Component {
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
for (const tab of filteredTabs) {
-
await this.openContextWithNote(tab.notePath, tab.active, tab.ntxId, tab.hoistedNoteId, tab.mainNtxId);
}
});
// if there's notePath in the URL, make sure it's open and active
// (useful, for e.g. opening clipped notes from clipper or opening link in an extra window)
- if (treeService.isNotePathInAddress()) {
- const [notePath, ntxId] = treeService.getHashValueFromAddress();
-
- await appContext.tabManager.switchToNoteContext(ntxId, notePath);
+ if (notePathInUrl) {
+ await appContext.tabManager.switchToNoteContext(ntxIdInUrl, notePathInUrl);
}
}
catch (e) {
diff --git a/src/public/app/widgets/buttons/right_dropdown_button.js b/src/public/app/widgets/buttons/right_dropdown_button.js
index 53a4808d9..14c95acaa 100644
--- a/src/public/app/widgets/buttons/right_dropdown_button.js
+++ b/src/public/app/widgets/buttons/right_dropdown_button.js
@@ -4,7 +4,6 @@ const TPL = `
diff --git a/src/public/app/widgets/containers/left_pane_container.js b/src/public/app/widgets/containers/left_pane_container.js
index 5c6c06550..fa1915a1e 100644
--- a/src/public/app/widgets/containers/left_pane_container.js
+++ b/src/public/app/widgets/containers/left_pane_container.js
@@ -1,5 +1,6 @@
import options from "../../services/options.js";
import FlexContainer from "./flex_container.js";
+import appContext from "../../components/app_context.js";
export default class LeftPaneContainer extends FlexContainer {
constructor() {
@@ -16,7 +17,15 @@ export default class LeftPaneContainer extends FlexContainer {
entitiesReloadedEvent({loadResults}) {
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});
+ }
}
}
}
diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js
index 204bb77db..93a070fd7 100644
--- a/src/public/app/widgets/note_tree.js
+++ b/src/public/app/widgets/note_tree.js
@@ -886,6 +886,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
}
}
+ async focusTreeEvent() {
+ this.tree.$container.focus();
+ this.tree.setFocus(true);
+ }
+
/** @returns {FancytreeNode} */
async getNodeFromPath(notePath, expand = false, logErrors = true) {
utils.assertArguments(notePath);
diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css
index 95dd1a0ca..e32fb4a47 100644
--- a/src/public/stylesheets/style.css
+++ b/src/public/stylesheets/style.css
@@ -871,12 +871,11 @@ body {
#launcher-pane .launcher-button {
font-size: 150%;
display: inline-block;
- padding: 15px 15px;
+ padding: 13px 13px;
cursor: pointer;
border: none;
color: var(--launcher-pane-text-color);
background-color: var(--launcher-pane-background-color);
- width: 53px;
height: 53px;
}