mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
Merge branch 'master' into dev
# Conflicts: # package-lock.json # src/public/app/entities/fnote.js # src/services/notes.js
This commit is contained in:
commit
15607becc6
BIN
db/demo.zip
BIN
db/demo.zip
Binary file not shown.
@ -79,11 +79,12 @@ export default class TabManager extends Component {
|
|||||||
filteredTabs = filteredTabs.filter(tab => tab.active);
|
filteredTabs = filteredTabs.filter(tab => tab.active);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filteredTabs.length === 0) {
|
// resolve before opened tabs can change this
|
||||||
const [notePath] = treeService.getHashValueFromAddress();
|
const [notePathInUrl, ntxIdInUrl] = treeService.getHashValueFromAddress();
|
||||||
|
|
||||||
|
if (filteredTabs.length === 0) {
|
||||||
filteredTabs.push({
|
filteredTabs.push({
|
||||||
notePath: notePath || 'root',
|
notePath: notePathInUrl || 'root',
|
||||||
active: true,
|
active: true,
|
||||||
hoistedNoteId: glob.extraHoistedNoteId || 'root'
|
hoistedNoteId: glob.extraHoistedNoteId || 'root'
|
||||||
});
|
});
|
||||||
@ -95,17 +96,14 @@ export default class TabManager extends Component {
|
|||||||
|
|
||||||
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
|
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
|
||||||
for (const tab of filteredTabs) {
|
for (const tab of filteredTabs) {
|
||||||
|
|
||||||
await this.openContextWithNote(tab.notePath, tab.active, tab.ntxId, tab.hoistedNoteId, tab.mainNtxId);
|
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
|
// 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)
|
// (useful, for e.g. opening clipped notes from clipper or opening link in an extra window)
|
||||||
if (treeService.isNotePathInAddress()) {
|
if (notePathInUrl) {
|
||||||
const [notePath, ntxId] = treeService.getHashValueFromAddress();
|
await appContext.tabManager.switchToNoteContext(ntxIdInUrl, notePathInUrl);
|
||||||
|
|
||||||
await appContext.tabManager.switchToNoteContext(ntxId, notePath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
@ -4,7 +4,6 @@ const TPL = `
|
|||||||
<div class="dropdown right-dropdown-widget dropright">
|
<div class="dropdown right-dropdown-widget dropright">
|
||||||
<style>
|
<style>
|
||||||
.right-dropdown-widget {
|
.right-dropdown-widget {
|
||||||
width: 53px;
|
|
||||||
height: 53px;
|
height: 53px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -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});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -886,6 +886,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);
|
||||||
|
@ -871,12 +871,11 @@ body {
|
|||||||
#launcher-pane .launcher-button {
|
#launcher-pane .launcher-button {
|
||||||
font-size: 150%;
|
font-size: 150%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 15px 15px;
|
padding: 13px 13px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
color: var(--launcher-pane-text-color);
|
color: var(--launcher-pane-text-color);
|
||||||
background-color: var(--launcher-pane-background-color);
|
background-color: var(--launcher-pane-background-color);
|
||||||
width: 53px;
|
|
||||||
height: 53px;
|
height: 53px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user