Changeset 2901815
- Timestamp:
- 04/20/2023 12:54:27 PM (3 years ago)
- Location:
- printapp
- Files:
-
- 1 edited
- 1 copied
-
tags/1.0.2/js/designTreeSelect.js (copied) (copied from printapp/trunk/js/designTreeSelect.js) (3 diffs)
-
trunk/js/designTreeSelect.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
printapp/tags/1.0.2/js/designTreeSelect.js
r2885461 r2901815 147 147 sel.innerHTML = html; 148 148 sel.style.display = 'none'; 149 150 149 main.style.display='none'; 150 151 // SET RADIO BUTTONS UPON DIV AND LABEL CLICK 152 function listenLabelAndDivClick() { 153 document.querySelectorAll(".print_app_design_list .item").forEach(_=>{ 154 _.addEventListener('click',function(e) { 155 if (e.target.children && e.target.children[0] && e.target.children[0].type === 'radio') 156 e.target.children[0].checked = true; 157 }); 158 }); 159 document.querySelectorAll(".print_app_design_list .item span").forEach(_=>{ 160 _.addEventListener('click',function(e) { 161 if (e.target.parentElement.children[0].type === 'radio') 162 e.target.parentElement.children[0].checked = true; 163 }); 164 }); 165 } 166 // SET RADIO BUTTONS UPON DIV AND LABEL CLICK 167 function listenLabelAndDivClick() { 168 document.querySelectorAll(".print_app_design_list .item").forEach(_=>{ 169 _.addEventListener('click',function(e) { 170 if (e.target.children && e.target.children[0] && e.target.children[0].type === 'radio') 171 e.target.children[0].checked = true; 172 }); 173 }); 174 document.querySelectorAll(".print_app_design_list .item span").forEach(_=>{ 175 _.addEventListener('click',function(e) { 176 if (e.target.parentElement.children[0].type === 'radio') 177 e.target.parentElement.children[0].checked = true; 178 }); 179 }); 180 } 151 181 const cDesignVals = print_app_current_design.split('__'); 152 182 main.insertAdjacentHTML('beforebegin', `<div class="print_app_select"> … … 158 188 159 189 main.insertAdjacentElement('beforebegin',sel); 190 listenLabelAndDivClick(); 160 191 161 192 // WHEN DROPDOWN IS CLICKED, SHOW THE LIST … … 223 254 list += '</div>'; 224 255 target.parentElement.parentElement.insertAdjacentHTML('beforeend',list); 256 listenLabelAndDivClick(); 225 257 226 258 chevStatus[target.dataset.id] = {}; -
printapp/trunk/js/designTreeSelect.js
r2885461 r2901815 147 147 sel.innerHTML = html; 148 148 sel.style.display = 'none'; 149 150 149 main.style.display='none'; 150 151 // SET RADIO BUTTONS UPON DIV AND LABEL CLICK 152 function listenLabelAndDivClick() { 153 document.querySelectorAll(".print_app_design_list .item").forEach(_=>{ 154 _.addEventListener('click',function(e) { 155 if (e.target.children && e.target.children[0] && e.target.children[0].type === 'radio') 156 e.target.children[0].checked = true; 157 }); 158 }); 159 document.querySelectorAll(".print_app_design_list .item span").forEach(_=>{ 160 _.addEventListener('click',function(e) { 161 if (e.target.parentElement.children[0].type === 'radio') 162 e.target.parentElement.children[0].checked = true; 163 }); 164 }); 165 } 166 // SET RADIO BUTTONS UPON DIV AND LABEL CLICK 167 function listenLabelAndDivClick() { 168 document.querySelectorAll(".print_app_design_list .item").forEach(_=>{ 169 _.addEventListener('click',function(e) { 170 if (e.target.children && e.target.children[0] && e.target.children[0].type === 'radio') 171 e.target.children[0].checked = true; 172 }); 173 }); 174 document.querySelectorAll(".print_app_design_list .item span").forEach(_=>{ 175 _.addEventListener('click',function(e) { 176 if (e.target.parentElement.children[0].type === 'radio') 177 e.target.parentElement.children[0].checked = true; 178 }); 179 }); 180 } 151 181 const cDesignVals = print_app_current_design.split('__'); 152 182 main.insertAdjacentHTML('beforebegin', `<div class="print_app_select"> … … 158 188 159 189 main.insertAdjacentElement('beforebegin',sel); 190 listenLabelAndDivClick(); 160 191 161 192 // WHEN DROPDOWN IS CLICKED, SHOW THE LIST … … 223 254 list += '</div>'; 224 255 target.parentElement.parentElement.insertAdjacentHTML('beforeend',list); 256 listenLabelAndDivClick(); 225 257 226 258 chevStatus[target.dataset.id] = {};
Note: See TracChangeset
for help on using the changeset viewer.