1
0
Fork 0
mirror of https://github.com/Alamantus/Lexiconga.git synced 2025-06-04 16:26:36 +02:00

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

View file

@ -96,7 +96,7 @@ export function renderStats() {
detailsPanel.innerHTML = numberOfWordsHTML + wordLengthHTML + letterDistributionHTML + totalLettersHTML;
}
export function renderPartsOfSpeech() {
export function renderPartsOfSpeech(onlyOptions = false) {
let optionsHTML = '<option value=""></option>',
searchHTML = '<label>Unclassified <input type="checkbox" checked id="searchPartOfSpeech__None"></label>';
window.currentDictionary.partsOfSpeech.forEach(partOfSpeech => {
@ -110,7 +110,9 @@ export function renderPartsOfSpeech() {
select.innerHTML = optionsHTML;
select.value = selectedValue;
});
document.getElementById('searchPartsOfSpeech').innerHTML = searchHTML;
if (!onlyOptions) {
document.getElementById('searchPartsOfSpeech').innerHTML = searchHTML;
}
setupSearchFilters();
}
@ -273,6 +275,7 @@ export function renderEditForm(wordId = false) {
document.getElementById(wordId.toString()).innerHTML = editForm;
setupWordEditFormButtons();
renderPartsOfSpeech(true);
}
}