diff --git a/pages/wins/wins.html b/pages/wins/wins.html index d232413982..6330158695 100644 --- a/pages/wins/wins.html +++ b/pages/wins/wins.html @@ -269,8 +269,23 @@ } } + function insertIcons(cloneCardTemplate, cardClass, cardString) { - let cardList = cardString.split(',').map(item => item.trim()) + let initialCardList = cardString.split(',').map(item => item.trim()) + let otherWinsText = []; + let cardList = []; + + initialCardList.forEach(win => { + if (badgeIcons.hasOwnProperty(win)){ + cardList.push(win); + } else if (win === " "){ + return + } else { + otherWinsText.push(win); + } + }); + cardList.push(otherWinsText.join(", ")); + const SVG_FILE_PATH = `/assets/images/wins-page/wins-badges/` cardList.map(function (item) { @@ -479,6 +494,7 @@ const item = string.trim() const SVG_FILE_PATH = `/assets/images/wins-page/wins-badges/` + if (badgeIcons.hasOwnProperty(item)) { cloneCardTemplate.insertAdjacentHTML('beforeend', `