From 013e5aaec9af2f6a4f74ac7153b0256cfa088c87 Mon Sep 17 00:00:00 2001 From: Ashish <51633862+ashishjh-bst@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:29:55 +0530 Subject: [PATCH] Fixed with incorrect value cm toggle on refresh (#1689) * added a checkbox to switch between codeMirror and plain text editor * fix incorrect value of CM checkbox on refresh --------- Co-authored-by: Ashish Jhanwar --- customcommands/assets/customcommands-editcmd.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/customcommands/assets/customcommands-editcmd.html b/customcommands/assets/customcommands-editcmd.html index 01e620c2c4..3d49ba5e56 100644 --- a/customcommands/assets/customcommands-editcmd.html +++ b/customcommands/assets/customcommands-editcmd.html @@ -553,10 +553,10 @@

Custom Command Information

$(function () { triggerTypeChanged(); - updateCCLength(); updateTriggerLength(); updateNameLength(); + setCMCheckbox(); }); var intervalTriggerEls = ['#interval-cc-run-now', '#cc-time-trigger-details']; @@ -579,6 +579,14 @@

Custom Command Information

none: ['#trigger-desc-none'], }; + function setCMCheckbox() { + if(localStorage.getItem('cm-editor') === 'false'){ + $("#toggle-code-mirror").prop( "checked", false ); + } else { + $("#toggle-code-mirror").prop( "checked", true ); + } + } + function triggerTypeChanged() { const curTriggerType = $('#trigger-type-dropdown').val(); @@ -744,6 +752,7 @@

Custom Command Information

}