From e4369f0ffd36871625928544f2d945cbb8e59d0a Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Fri, 3 May 2019 11:45:26 -0600 Subject: [PATCH] Add render funciton fo populate parts of speech --- index.html | 6 +++--- src/js/render.js | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index b36a7e4..4019a06 100644 --- a/index.html +++ b/index.html @@ -23,13 +23,13 @@ diff --git a/src/js/render.js b/src/js/render.js index f2be93c..86563f5 100644 --- a/src/js/render.js +++ b/src/js/render.js @@ -5,6 +5,7 @@ import { showSection } from './displayToggles'; export function renderAll() { renderDictionaryDetails(); + renderPartsOfSpeechSelect(); renderWords(); } @@ -81,6 +82,15 @@ export function renderStats() { detailsPanel.innerHTML = numberOfWordsHTML + wordLengthHTML + letterDistributionHTML + totalLettersHTML; } +export function renderPartsOfSpeechSelect() { + let optionsHTML = ''; + window.currentDictionary.partsOfSpeech.forEach(partOfSpeech => { + partOfSpeech = removeTags(partOfSpeech); + optionsHTML += ``; + }); + Array.from(document.getElementsByClassName('part-of-speech-select')).forEach(select => select.innerHTML = optionsHTML); +} + export function renderWords() { const { words } = window.currentDictionary; let wordsHTML = '';