mirror of
https://github.com/Alamantus/Lexiconga.git
synced 2025-05-07 02:31:16 +02:00
Clear and refocus word form after add
This commit is contained in:
parent
5d38aa4e17
commit
048c964405
1 changed files with 11 additions and 0 deletions
|
@ -64,9 +64,20 @@ export function submitWordForm() {
|
||||||
|
|
||||||
if (validateWord(word)) {
|
if (validateWord(word)) {
|
||||||
addWord(word);
|
addWord(word);
|
||||||
|
clearWordForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function clearWordForm() {
|
||||||
|
document.getElementById('wordName').value = '';
|
||||||
|
document.getElementById('wordPronunciation').value = '';
|
||||||
|
document.getElementById('wordPartOfSpeech').value = '';
|
||||||
|
document.getElementById('wordDefinition').value = '';
|
||||||
|
document.getElementById('wordDetails').value = '';
|
||||||
|
|
||||||
|
document.getElementById('wordName').focus();
|
||||||
|
}
|
||||||
|
|
||||||
export function addWord(word, render = true) {
|
export function addWord(word, render = true) {
|
||||||
window.currentDictionary.words.push(word);
|
window.currentDictionary.words.push(word);
|
||||||
addMessage('Word Created Successfully');
|
addMessage('Word Created Successfully');
|
||||||
|
|
Loading…
Add table
Reference in a new issue