mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix "go to note" from note autocomplete
This commit is contained in:
parent
f85209a72f
commit
274505188b
@ -108,12 +108,16 @@ function calculateHash({notePath, ntxId, hoistedNoteId, viewScope = {}}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseNavigationStateFromUrl(url) {
|
function parseNavigationStateFromUrl(url) {
|
||||||
const hashIdx = url?.indexOf('#');
|
if (!url) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
const hashIdx = url.indexOf('#');
|
||||||
if (hashIdx === -1) {
|
if (hashIdx === -1) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const hash = url?.substr(hashIdx + 1); // strip also the initial '#'
|
const hash = url.substr(hashIdx + 1); // strip also the initial '#'
|
||||||
const [notePath, paramString] = hash.split("?");
|
const [notePath, paramString] = hash.split("?");
|
||||||
const viewScope = {
|
const viewScope = {
|
||||||
viewMode: 'default'
|
viewMode: 'default'
|
||||||
|
@ -247,7 +247,7 @@ function init() {
|
|||||||
.closest(".input-group")
|
.closest(".input-group")
|
||||||
.find(".go-to-selected-note-button")
|
.find(".go-to-selected-note-button")
|
||||||
.toggleClass("disabled", !notePath.trim())
|
.toggleClass("disabled", !notePath.trim())
|
||||||
.attr(SELECTED_NOTE_PATH_KEY, notePath); // we also set attr here so tooltip can be displayed
|
.attr("href", `#${notePath}`); // we also set href here so tooltip can be displayed
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.getSelectedExternalLink = function () {
|
$.fn.getSelectedExternalLink = function () {
|
||||||
@ -259,12 +259,14 @@ function init() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$.fn.setSelectedExternalLink = function (externalLink) {
|
$.fn.setSelectedExternalLink = function (externalLink) {
|
||||||
$(this).attr(SELECTED_EXTERNAL_LINK_KEY, externalLink);
|
console.trace("setSelectedExternalLink");
|
||||||
|
|
||||||
$(this)
|
if (externalLink) {
|
||||||
.closest(".input-group")
|
$(this)
|
||||||
.find(".go-to-selected-note-button")
|
.closest(".input-group")
|
||||||
.toggleClass("disabled", true);
|
.find(".go-to-selected-note-button")
|
||||||
|
.toggleClass("disabled", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.fn.setNote = async function (noteId) {
|
$.fn.setNote = async function (noteId) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user