Render parts of speech on edit form

This commit is contained in:
Robbie Antenesse 2019-05-22 13:57:16 -06:00
parent 2d93a51236
commit cfb4563909
1 changed files with 5 additions and 2 deletions

View File

@ -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);
} }
} }