Customize addWord messaging

This commit is contained in:
Robbie Antenesse 2019-05-10 15:31:01 -06:00
parent 048c964405
commit 3f17a19c50
1 changed files with 5 additions and 3 deletions

View File

@ -74,13 +74,15 @@ export function clearWordForm() {
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, message = true) {
window.currentDictionary.words.push(word);
addMessage('Word Created Successfully');
if (message) {
addMessage(`<a href="#${word.wordId}">${word.name}</a> Created Successfully`, 10000);
}
sortWords(render);
}