fixed switching between note clones

This commit is contained in:
azivner 2018-01-02 20:16:17 -05:00
parent 664a87cdd5
commit 550bb77ca9

View file

@ -42,20 +42,24 @@ const link = (function() {
e.preventDefault(); e.preventDefault();
const linkEl = $(e.target); const linkEl = $(e.target);
const address = linkEl.attr("note-path") ? linkEl.attr("note-path") : linkEl.attr('href'); let notePath = linkEl.attr("note-path");
if (!address) { if (!notePath) {
return; const address = linkEl.attr("note-path") ? linkEl.attr("note-path") : linkEl.attr('href');
if (!address) {
return;
}
if (address.startsWith('http')) {
window.open(address, '_blank');
return;
}
notePath = getNotePathFromLink(address);
} }
if (address.startsWith('http')) {
window.open(address, '_blank');
return;
}
const notePath = getNotePathFromLink(address);
noteTree.activateNode(notePath); noteTree.activateNode(notePath);
// this is quite ugly hack, but it seems like we can't close the tooltip otherwise // this is quite ugly hack, but it seems like we can't close the tooltip otherwise