mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
image note should reload after uploading new revision
This commit is contained in:
parent
b2d460d5c1
commit
c3f5bb5518
@ -49,7 +49,7 @@ export default class ImagePropertiesWidget extends NoteContextAwareWidget {
|
|||||||
return this.note && this.note.type === 'image';
|
return this.note && this.note.type === 'image';
|
||||||
}
|
}
|
||||||
|
|
||||||
getTitle(note) {
|
getTitle() {
|
||||||
return {
|
return {
|
||||||
show: this.isEnabled(),
|
show: this.isEnabled(),
|
||||||
activate: true,
|
activate: true,
|
||||||
|
@ -90,7 +90,7 @@ class ImageTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async doRefresh(note) {
|
async doRefresh(note) {
|
||||||
this.$imageView.prop("src", `api/images/${note.noteId}/${encodeURIComponent(note.title)}`);
|
this.$imageView.prop("src", `api/images/${note.noteId}/${encodeURIComponent(note.title)}?timestamp=${Date.now()}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
copyImageReferenceToClipboardEvent({ntxId}) {
|
copyImageReferenceToClipboardEvent({ntxId}) {
|
||||||
@ -100,6 +100,12 @@ class ImageTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
imageService.copyImageReferenceToClipboard(this.$imageWrapper);
|
imageService.copyImageReferenceToClipboard(this.$imageWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async entitiesReloadedEvent({loadResults}) {
|
||||||
|
if (loadResults.isNoteReloaded(this.noteId)) {
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ImageTypeWidget
|
export default ImageTypeWidget
|
||||||
|
@ -11,9 +11,7 @@ export default class TypeWidget extends NoteContextAwareWidget {
|
|||||||
return super.doRender();
|
return super.doRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @param {FNote} note */
|
||||||
* @param {FNote} note
|
|
||||||
*/
|
|
||||||
async doRefresh(note) {}
|
async doRefresh(note) {}
|
||||||
|
|
||||||
async refresh() {
|
async refresh() {
|
||||||
@ -38,9 +36,7 @@ export default class TypeWidget extends NoteContextAwareWidget {
|
|||||||
return this.$widget.is(":visible") && this.noteContext?.ntxId === appContext.tabManager.activeNtxId;
|
return this.$widget.is(":visible") && this.noteContext?.ntxId === appContext.tabManager.activeNtxId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @returns {Promise<Object>|*} promise resolving note data. Note data is an object with content. */
|
||||||
* @returns {Promise<Object>|*} promise resolving note data. Note data is an object with content.
|
|
||||||
*/
|
|
||||||
getData() {}
|
getData() {}
|
||||||
|
|
||||||
focus() {}
|
focus() {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user