From dc1cd890eeb1828b4315f00dbef6151b57f600e2 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 14 Jan 2018 17:40:09 +0300 Subject: [PATCH] notify event subscribers when toggling the style via Alt-Enter --- edit/edit.js | 2 +- edit/source-editor.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/edit/edit.js b/edit/edit.js index ea5fd9f3..5f78b641 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -341,7 +341,7 @@ function setCleanSection(section) { } function toggleStyle() { - $('#enabled').checked = !$('#enabled').checked; + $('#enabled').dispatchEvent(new MouseEvent('click', {bubbles: true})); } function save() { diff --git a/edit/source-editor.js b/edit/source-editor.js index ab909b8c..256e065d 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -186,6 +186,7 @@ function createSourceEditor(style) { dirty.modify('enabled', style.enabled, value); style.enabled = value; updateMeta(); + $('#enabled').dispatchEvent(new Event('change', {bubbles: true})); } function save() {