shx-3d-render

main
Jan Umbach 2024-06-22 13:42:42 +02:00
parent a4288765f8
commit 5a199c32b1
1 changed files with 5 additions and 1 deletions

View File

@ -294,7 +294,11 @@
<div id="${inputID}" class="shx-ifc-colorselect"> <div id="${inputID}" class="shx-ifc-colorselect">
`; `;
for(let color in options) { // Convert object to Map
let optionsMap = new Map(Object.entries(options));
// Iterate over the Map
for (let [color, value] of optionsMap) {
html += ` html += `
<input type="radio" id="${inputID}-${color}" form="product-form-${section_id}" name="properties[${inputName}]" value="${options[color].name} #${color}" ${inputVal === color ? 'checked' : ''}> <input type="radio" id="${inputID}-${color}" form="product-form-${section_id}" name="properties[${inputName}]" value="${options[color].name} #${color}" ${inputVal === color ? 'checked' : ''}>
<label for="${inputID}-${color}" style="background-color: ${options[color].hex};"> <label for="${inputID}-${color}" style="background-color: ${options[color].hex};">