refresh button state change on note update

This commit is contained in:
zadam 2020-05-05 22:18:09 +02:00
parent 3b268cc8eb
commit 7f2755d4a0

View File

@ -20,7 +20,13 @@ export default class RunScriptButtonsWidget extends TabAwareWidget {
}
refreshWithNote(note) {
this.$renderButton.toggle(note.type === 'render');
this.$renderButton.toggle(note.type === 'render');console.log("note.mime", note.mime);
this.$executeScriptButton.toggle(note.mime.startsWith('application/javascript'));
}
async entitiesReloadedEvent({loadResults}) {
if (loadResults.isNoteReloaded(this.noteId)) {
this.refresh();
}
}
}