From 3f17a19c504133bd5b4ae3c1517db0dafeb69314 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Fri, 10 May 2019 15:31:01 -0600 Subject: [PATCH] Customize addWord messaging --- src/js/wordManagement.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/wordManagement.js b/src/js/wordManagement.js index 47a9a11..a403b61 100644 --- a/src/js/wordManagement.js +++ b/src/js/wordManagement.js @@ -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(`${word.name} Created Successfully`, 10000); + } sortWords(render); }