mirror of
https://github.com/zadam/trilium.git
synced 2024-09-20 15:45:58 +08:00
fixed race condition when changing note path in URL hash which caused flickering
This commit is contained in:
parent
e560072f8b
commit
f07c427da1
|
@ -209,8 +209,6 @@ const noteTree = (function() {
|
|||
|
||||
let parentNoteId = 'root';
|
||||
|
||||
//console.log(now(), "Run path: ", runPath);
|
||||
|
||||
for (const childNoteId of runPath) {
|
||||
const node = getNodesByNoteId(childNoteId).find(node => node.data.parent_note_id === parentNoteId);
|
||||
|
||||
|
@ -223,6 +221,8 @@ const noteTree = (function() {
|
|||
|
||||
parentNoteId = childNoteId;
|
||||
}
|
||||
|
||||
clearSelectedNodes();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -391,7 +391,11 @@ const noteTree = (function() {
|
|||
selectedNode.setSelected(false);
|
||||
}
|
||||
|
||||
getCurrentNode().setSelected(true);
|
||||
const currentNode = getCurrentNode();
|
||||
|
||||
if (currentNode) {
|
||||
currentNode.setSelected(true);
|
||||
}
|
||||
}
|
||||
|
||||
function initFancyTree(noteTree) {
|
||||
|
@ -803,7 +807,11 @@ const noteTree = (function() {
|
|||
$(window).bind('hashchange', function() {
|
||||
const notePath = getNotePathFromAddress();
|
||||
|
||||
activateNode(notePath);
|
||||
if (getCurrentNotePath() !== notePath) {
|
||||
console.log("Switching to " + notePath + " because of hash change");
|
||||
|
||||
activateNode(notePath);
|
||||
}
|
||||
});
|
||||
|
||||
if (isElectron()) {
|
||||
|
|
|
@ -175,7 +175,6 @@ div.ui-tooltip {
|
|||
|
||||
/* Allow to use <kbd> elements inside the title to define shortcut hints. */
|
||||
.ui-menu kbd, button kbd {
|
||||
float: right;
|
||||
color: black;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
|
@ -184,6 +183,7 @@ div.ui-tooltip {
|
|||
|
||||
.ui-menu kbd {
|
||||
margin-left: 30px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#note-id-display {
|
||||
|
|
Loading…
Reference in a new issue