diff --git a/src/public/app/services/link.ts b/src/public/app/services/link.ts index 138df7221..a0d464741 100644 --- a/src/public/app/services/link.ts +++ b/src/public/app/services/link.ts @@ -278,15 +278,20 @@ function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent | JQuery.MouseDownEvent const { notePath, viewScope } = parseNavigationStateFromUrl(hrefLink); const ctrlKey = utils.isCtrlKey(evt); + const shiftKey = evt.shiftKey; const isLeftClick = "which" in evt && evt.which === 1; const isMiddleClick = "which" in evt && evt.which === 2; const targetIsBlank = ($link?.attr("target") === "_blank"); const openInNewTab = (isLeftClick && ctrlKey) || isMiddleClick || targetIsBlank; + const activate = (isLeftClick && ctrlKey && shiftKey) || (isMiddleClick && shiftKey); + const openInNewWindow = isLeftClick && evt.shiftKey && !ctrlKey; if (notePath) { - if (openInNewTab) { + if (openInNewWindow) { + appContext.triggerCommand("openInWindow", { notePath, viewScope }); + } else if (openInNewTab) { appContext.tabManager.openTabWithNoteWithHoisting(notePath, { - activate: targetIsBlank, + activate: activate ? true : targetIsBlank, viewScope }); } else if (isLeftClick) { diff --git a/src/public/app/widgets/ribbon_widgets/note_paths.ts b/src/public/app/widgets/ribbon_widgets/note_paths.ts index 961878589..131fed2a4 100644 --- a/src/public/app/widgets/ribbon_widgets/note_paths.ts +++ b/src/public/app/widgets/ribbon_widgets/note_paths.ts @@ -19,15 +19,15 @@ const TPL = /*html*/` margin-top: 10px; } - .note-path-list .path-current { + .note-path-list .path-current a { font-weight: bold; } - .note-path-list .path-archived { + .note-path-list .path-archived a { color: var(--muted-text-color) !important; } - .note-path-list .path-search { + .note-path-list .path-search a { font-style: italic; } @@ -72,7 +72,7 @@ export default class NotePathsWidget extends NoteContextAwareWidget { this.$notePathList.empty(); if (!this.note || this.noteId === "root") { - this.$notePathList.empty().append(await this.getRenderedPath("root")); + this.$notePathList.empty().append(await this.getRenderedPath(["root"])); return; } @@ -88,7 +88,7 @@ export default class NotePathsWidget extends NoteContextAwareWidget { const renderedPaths = []; for (const notePathRecord of sortedNotePaths) { - const notePath = notePathRecord.notePath.join("/"); + const notePath = notePathRecord.notePath; renderedPaths.push(await this.getRenderedPath(notePath, notePathRecord)); } @@ -96,42 +96,54 @@ export default class NotePathsWidget extends NoteContextAwareWidget { this.$notePathList.empty().append(...renderedPaths); } - async getRenderedPath(notePath: string, notePathRecord: NotePathRecord | null = null) { - const title = await treeService.getNotePathTitle(notePath); + async getRenderedPath(notePath: string[], notePathRecord: NotePathRecord | null = null) { + const $pathItem = $("