Render parts of speech on edit form
This commit is contained in:
parent
2d93a51236
commit
cfb4563909
|
@ -96,7 +96,7 @@ export function renderStats() {
|
||||||
detailsPanel.innerHTML = numberOfWordsHTML + wordLengthHTML + letterDistributionHTML + totalLettersHTML;
|
detailsPanel.innerHTML = numberOfWordsHTML + wordLengthHTML + letterDistributionHTML + totalLettersHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderPartsOfSpeech() {
|
export function renderPartsOfSpeech(onlyOptions = false) {
|
||||||
let optionsHTML = '<option value=""></option>',
|
let optionsHTML = '<option value=""></option>',
|
||||||
searchHTML = '<label>Unclassified <input type="checkbox" checked id="searchPartOfSpeech__None"></label>';
|
searchHTML = '<label>Unclassified <input type="checkbox" checked id="searchPartOfSpeech__None"></label>';
|
||||||
window.currentDictionary.partsOfSpeech.forEach(partOfSpeech => {
|
window.currentDictionary.partsOfSpeech.forEach(partOfSpeech => {
|
||||||
|
@ -110,7 +110,9 @@ export function renderPartsOfSpeech() {
|
||||||
select.innerHTML = optionsHTML;
|
select.innerHTML = optionsHTML;
|
||||||
select.value = selectedValue;
|
select.value = selectedValue;
|
||||||
});
|
});
|
||||||
document.getElementById('searchPartsOfSpeech').innerHTML = searchHTML;
|
if (!onlyOptions) {
|
||||||
|
document.getElementById('searchPartsOfSpeech').innerHTML = searchHTML;
|
||||||
|
}
|
||||||
|
|
||||||
setupSearchFilters();
|
setupSearchFilters();
|
||||||
}
|
}
|
||||||
|
@ -273,6 +275,7 @@ export function renderEditForm(wordId = false) {
|
||||||
|
|
||||||
document.getElementById(wordId.toString()).innerHTML = editForm;
|
document.getElementById(wordId.toString()).innerHTML = editForm;
|
||||||
setupWordEditFormButtons();
|
setupWordEditFormButtons();
|
||||||
|
renderPartsOfSpeech(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue