From 6bca99604e8f1319596ec544d394bf8b88fc1306 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 --- .../assets/customcommands-editcmd.html | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/customcommands/assets/customcommands-editcmd.html b/customcommands/assets/customcommands-editcmd.html index 4c09ef497..3d49ba5e5 100644 --- a/customcommands/assets/customcommands-editcmd.html +++ b/customcommands/assets/customcommands-editcmd.html @@ -284,8 +284,13 @@

+ + + + + {{range .CC.Responses}}
@@ -309,6 +314,7 @@

+ {{end}} Info @@ -547,10 +553,10 @@

Custom Command Information

$(function () { triggerTypeChanged(); - updateCCLength(); updateTriggerLength(); updateNameLength(); + setCMCheckbox(); }); var intervalTriggerEls = ['#interval-cc-run-now', '#cc-time-trigger-details']; @@ -573,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(); @@ -681,6 +695,7 @@

Custom Command Information

$(`#${this.warningId}`).remove(); }, }; + $('#time-trigger-channel').change(() => checkMissingIntervalTriggerChannel.run()); function updateTriggerLength() { @@ -737,7 +752,10 @@

Custom Command Information

}