Skip to content

Commit

Permalink
use replaceAll
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrk24 committed Mar 15, 2024
1 parent e76a889 commit 9e92974
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.civet
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ updatePreview()
[characterDropdown, kartDropdown, wheelDropdown, gliderDropdown].forEach .addEventListener 'change', updatePreview, { +passive }

function setPreviewedKart(character: string, kart: string, wheels: string, glider: string)
characterDropdown.selectedIndex = Array::findIndex.call characterDropdown.options, &.textContent.replace(' ', '') is character
kartDropdown.selectedIndex = Array::findIndex.call kartDropdown.options, &.textContent.replace(' ', '') is kart
wheelDropdown.selectedIndex = Array::findIndex.call wheelDropdown.options, &.textContent.replace(' ', '') is wheels
gliderDropdown.selectedIndex = Array::findIndex.call gliderDropdown.options, &.textContent.replace(' ', '') is glider
characterDropdown.selectedIndex = Array::findIndex.call characterDropdown.options, &.textContent.replaceAll(' ', '') is character
kartDropdown.selectedIndex = Array::findIndex.call kartDropdown.options, &.textContent.replaceAll(' ', '') is kart
wheelDropdown.selectedIndex = Array::findIndex.call wheelDropdown.options, &.textContent.replaceAll(' ', '') is wheels
gliderDropdown.selectedIndex = Array::findIndex.call gliderDropdown.options, &.textContent.replaceAll(' ', '') is glider
updatePreview()

menu := document.querySelector 'menu'
Expand Down

0 comments on commit 9e92974

Please sign in to comment.