mirror of
https://github.com/zadam/trilium.git
synced 2025-10-31 18:36:30 +01:00
synchronous events, updating title works fully
This commit is contained in:
@@ -31,15 +31,13 @@ class NoteInfoWidget extends StandardWidget {
|
||||
this.$body.html(TPL);
|
||||
}
|
||||
|
||||
refreshWithNote() {
|
||||
refreshWithNote(note) {
|
||||
const $noteId = this.$body.find(".note-info-note-id");
|
||||
const $dateCreated = this.$body.find(".note-info-date-created");
|
||||
const $dateModified = this.$body.find(".note-info-date-modified");
|
||||
const $type = this.$body.find(".note-info-type");
|
||||
const $mime = this.$body.find(".note-info-mime");
|
||||
|
||||
const note = this.tabContext.note;
|
||||
|
||||
$noteId.text(note.noteId);
|
||||
$dateCreated
|
||||
.text(note.dateCreated)
|
||||
@@ -56,6 +54,15 @@ class NoteInfoWidget extends StandardWidget {
|
||||
.attr("title", note.mime);
|
||||
}
|
||||
|
||||
// this is interesting for this widget since dateModified had to change after update
|
||||
noteChangesSavedListener({noteId}) {
|
||||
const note = this.tabContext.note;
|
||||
|
||||
if (note && note.noteId === noteId) {
|
||||
this.refreshWithNote(note);
|
||||
}
|
||||
}
|
||||
|
||||
syncDataListener({data}) {
|
||||
if (data.find(sd => sd.entityName === 'notes' && sd.entityId === this.tabContext.note.noteId)) {
|
||||
this.refresh();
|
||||
|
||||
Reference in New Issue
Block a user