diff --git a/customprompts/mzta-custom-prompts.js b/customprompts/mzta-custom-prompts.js index 1a9c1f97..779b59e1 100644 --- a/customprompts/mzta-custom-prompts.js +++ b/customprompts/mzta-custom-prompts.js @@ -58,15 +58,6 @@ document.addEventListener('DOMContentLoaded', async () => { } btnNew.addEventListener('click', handleNewClick); - // Enable save button on input change - function handleInputChange(e) { - e.preventDefault(); - setSomethingChanged(); - } - document.querySelectorAll('.input_mod').forEach(element => { - element.addEventListener('change', handleInputChange); - }); - // Display selected value next to select input // function handleSelectChange(e) { // e.preventDefault(); @@ -352,6 +343,12 @@ function handleCheckboxChange(e) { //console.log('>>>>>>>> checked_val: ' + e.target.getAttribute('checked_val')); } +// Enable save button on input change +function handleInputChange(e) { + e.preventDefault(); + setSomethingChanged(); +} + //========= handling an item in a row - END @@ -461,6 +458,10 @@ function loadPromptsList(values){ checkbox_elements.forEach(element => { element.addEventListener('change', handleCheckboxChange); }); + + document.querySelectorAll('.input_mod').forEach(element => { + element.addEventListener('change', handleInputChange); + }); } function checkFields() {