From 7f2755d4a05b0c110b49df4cae660f4855343fe5 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 5 May 2020 22:18:09 +0200 Subject: [PATCH] refresh button state change on note update --- src/public/app/widgets/run_script_buttons.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/run_script_buttons.js b/src/public/app/widgets/run_script_buttons.js index a94a1e54f..f74b96be4 100644 --- a/src/public/app/widgets/run_script_buttons.js +++ b/src/public/app/widgets/run_script_buttons.js @@ -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(); + } + } } \ No newline at end of file