| 2710 | schedulePreview(); |
| 2711 | }; |
| 2712 | const sharedSelect = (rows, name, label, choices) => { |
| 2713 | const select = document.createElement('select'); |
| 2714 | select.className = 'optionsInput'; |
| 2715 | select.setAttribute('aria-label', label); |
| 2716 | const values = new Set(rows.map(row => row.querySelector('[name="' + name + '"]').value)); |
| 2717 | if (values.size > 1) select.add(new Option(t('analytics', 'Mixed — customize'), '')); |
| 2718 | choices.forEach(([value, text]) => select.add(new Option(text, value))); |
| 2719 | select.value = values.size === 1 ? [...values][0] : ''; |
| 2720 | select.addEventListener('change', () => { |
| 2721 | if (select.value) setAll(rows, name, select.value); |
| 2722 | }); |
| 2723 | return select; |
| 2724 | }; |
| 2725 | valueList.querySelectorAll('.chartMeasureStyle').forEach(element => element.remove()); |
| 2726 | [...valueList.children].forEach((row, index) => { |
| 2727 | const id = mapping.measures[index]; |