Made speakers drop-down selectable.
This commit is contained in:
parent
f2f907452b
commit
1575bf4292
|
@ -147,8 +147,19 @@ function initializeDialogEditor() {
|
||||||
// Speaker column
|
// Speaker column
|
||||||
const speakerTd = document.createElement('td');
|
const speakerTd = document.createElement('td');
|
||||||
if (item.type === 'speech') {
|
if (item.type === 'speech') {
|
||||||
const speaker = availableSpeakersCache.find(s => s.id === item.speaker_id);
|
const speakerSelect = document.createElement('select');
|
||||||
speakerTd.textContent = speaker ? speaker.name : 'Unknown Speaker';
|
speakerSelect.className = 'dialog-speaker-select';
|
||||||
|
availableSpeakersCache.forEach(speaker => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = speaker.id;
|
||||||
|
option.textContent = speaker.name;
|
||||||
|
if (speaker.id === item.speaker_id) option.selected = true;
|
||||||
|
speakerSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
speakerSelect.onchange = (e) => {
|
||||||
|
dialogItems[index].speaker_id = e.target.value;
|
||||||
|
};
|
||||||
|
speakerTd.appendChild(speakerSelect);
|
||||||
} else {
|
} else {
|
||||||
speakerTd.textContent = '—';
|
speakerTd.textContent = '—';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue