mirror of
https://github.com/Alamantus/Lexiconga.git
synced 2025-06-16 22:26:39 +02:00
Trim and filter etymology entries into array
This commit is contained in:
parent
4fee98c8fe
commit
5f15ec6353
1 changed files with 3 additions and 2 deletions
|
@ -186,7 +186,7 @@ export function submitWordForm() {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (removeTags(etymology).trim() !== '') {
|
if (removeTags(etymology).trim() !== '') {
|
||||||
word.etymology = removeTags(etymology).trim();
|
word.etymology = removeTags(etymology).split(',').map(w => w.trim()).filter(w => w.length > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validateWord(word)) {
|
if (validateWord(word)) {
|
||||||
|
@ -209,6 +209,7 @@ export function clearWordForm() {
|
||||||
document.getElementById('wordPartOfSpeech').value = '';
|
document.getElementById('wordPartOfSpeech').value = '';
|
||||||
document.getElementById('wordDefinition').value = '';
|
document.getElementById('wordDefinition').value = '';
|
||||||
document.getElementById('wordDetails').value = '';
|
document.getElementById('wordDetails').value = '';
|
||||||
|
document.getElementById('wordEtymology').value = '';
|
||||||
|
|
||||||
document.getElementById('wordName').focus();
|
document.getElementById('wordName').focus();
|
||||||
}
|
}
|
||||||
|
@ -283,7 +284,7 @@ export function confirmEditWord(id) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (removeTags(etymology).trim() !== '') {
|
if (removeTags(etymology).trim() !== '') {
|
||||||
word.etymology = removeTags(etymology).trim();
|
word.etymology = removeTags(etymology).split(',').map(w => w.trim()).filter(w => w.length > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validateWord(word, wordId)) {
|
if (validateWord(word, wordId)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue