mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
update note title in link map when note is renamed
This commit is contained in:
parent
a89629b3de
commit
153de63f4d
@ -1,4 +1,5 @@
|
|||||||
import CollapsibleWidget from "../collapsible_widget.js";
|
import CollapsibleWidget from "../collapsible_widget.js";
|
||||||
|
import treeCache from "../../services/tree_cache.js";
|
||||||
|
|
||||||
let linkMapContainerIdCtr = 1;
|
let linkMapContainerIdCtr = 1;
|
||||||
|
|
||||||
@ -89,5 +90,19 @@ export default class LinkMapWidget extends CollapsibleWidget {
|
|||||||
if (loadResults.getAttributes().find(attr => attr.type === 'relation' && (attr.noteId === this.noteId || attr.value === this.noteId))) {
|
if (loadResults.getAttributes().find(attr => attr.type === 'relation' && (attr.noteId === this.noteId || attr.value === this.noteId))) {
|
||||||
this.noteSwitched();
|
this.noteSwitched();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const changedNoteIds = loadResults.getNoteIds();
|
||||||
|
|
||||||
|
if (changedNoteIds.length > 0) {
|
||||||
|
const $linkMapContainer = this.$body.find('.link-map-container');
|
||||||
|
|
||||||
|
for (const noteId of changedNoteIds) {
|
||||||
|
const note = treeCache.notes[noteId];
|
||||||
|
|
||||||
|
if (note) {
|
||||||
|
$linkMapContainer.find(`a[data-note-path="${noteId}"]`).text(note.title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user