synchronous events, updating title works fully

This commit is contained in:
zadam
2020-01-19 20:18:02 +01:00
parent bd8e5f255b
commit 1098d75ce0
8 changed files with 112 additions and 15 deletions

View File

@@ -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();