correctly saving the enabled status with a direct edit on the page. see #621
This commit is contained in:
parent
3180898dce
commit
0041a8a6a4
1 changed files with 12 additions and 0 deletions
|
|
@ -806,6 +806,18 @@ function handleConfirmClick(e) {
|
||||||
async function handleCheckboxChange(e) {
|
async function handleCheckboxChange(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.target.setAttribute('checked_val', e.target.checked ? '1' : '0');
|
e.target.setAttribute('checked_val', e.target.checked ? '1' : '0');
|
||||||
|
|
||||||
|
if (e.target.classList.contains('enabled')) {
|
||||||
|
let tr = e.target.closest('tr');
|
||||||
|
if (tr) {
|
||||||
|
let idnum = tr.getAttribute('data-idnum');
|
||||||
|
let item = promptsList.get('idnum', idnum);
|
||||||
|
if (item && item.length > 0) {
|
||||||
|
item[0]._values.enabled = e.target.checked ? 1 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//console.log('>>>>>>>> checked_val: ' + e.target.getAttribute('checked_val'));
|
//console.log('>>>>>>>> checked_val: ' + e.target.getAttribute('checked_val'));
|
||||||
if (e.target.classList.contains('need_selected') || e.target.classList.contains('need_custom_text') || e.target.classList.contains('need_selected_new') || e.target.classList.contains('need_custom_text_new')) {
|
if (e.target.classList.contains('need_selected') || e.target.classList.contains('need_custom_text') || e.target.classList.contains('need_selected_new') || e.target.classList.contains('need_custom_text_new')) {
|
||||||
let textarea = e.target.closest('tr').querySelector('.text_output');
|
let textarea = e.target.closest('tr').querySelector('.text_output');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue