Fixed element deletions not working consistently

This commit is contained in:
AnonymousRandomPerson 2023-05-11 20:16:46 -04:00
parent de2bea290f
commit e8201f4727

View file

@ -578,7 +578,7 @@ function initDraw() {
inputButton.className = "btn btn-outline-secondary" inputButton.className = "btn btn-outline-secondary"
inputButton.title = "Remove website" inputButton.title = "Remove website"
inputButton.innerHTML = '<i class="bi bi-trash-fill" aria-hidden="true"></i>' inputButton.innerHTML = '<i class="bi bi-trash-fill" aria-hidden="true"></i>'
inputButton.addEventListener('click', () => removeFieldButton(inputGroup, array, index)) inputButton.addEventListener('click', () => removeFieldButton(inputGroup, websiteGroupElements, index))
} }
inputGroup.appendChild(inputButton) inputGroup.appendChild(inputButton)
} }
@ -621,7 +621,7 @@ function initDraw() {
inputButton.className = "btn btn-outline-secondary" inputButton.className = "btn btn-outline-secondary"
inputButton.title = "Remove subreddit" inputButton.title = "Remove subreddit"
inputButton.innerHTML = '<i class="bi bi-trash-fill" aria-hidden="true"></i>' inputButton.innerHTML = '<i class="bi bi-trash-fill" aria-hidden="true"></i>'
inputButton.addEventListener('click', () => removeFieldButton(inputGroup, array, index)) inputButton.addEventListener('click', () => removeFieldButton(inputGroup, subredditGroupElements, index))
} }
inputField.addEventListener('paste', event => { inputField.addEventListener('paste', event => {
@ -666,7 +666,7 @@ function initDraw() {
inputButton.className = "btn btn-outline-secondary" inputButton.className = "btn btn-outline-secondary"
inputButton.title = "Remove Discord invite" inputButton.title = "Remove Discord invite"
inputButton.innerHTML = '<i class="bi bi-trash-fill" aria-hidden="true"></i>' inputButton.innerHTML = '<i class="bi bi-trash-fill" aria-hidden="true"></i>'
inputButton.addEventListener('click', () => removeFieldButton(inputGroup, array, index)) inputButton.addEventListener('click', () => removeFieldButton(inputGroup, discordGroupElements, index))
} }
inputField.addEventListener('paste', event => { inputField.addEventListener('paste', event => {
@ -705,7 +705,7 @@ function initDraw() {
inputButton.className = "btn btn-outline-secondary" inputButton.className = "btn btn-outline-secondary"
inputButton.title = "Remove wiki page" inputButton.title = "Remove wiki page"
inputButton.innerHTML = '<i class="bi bi-trash-fill" aria-hidden="true"></i>' inputButton.innerHTML = '<i class="bi bi-trash-fill" aria-hidden="true"></i>'
inputButton.addEventListener('click', () => removeFieldButton(inputGroup, array, index)) inputButton.addEventListener('click', () => removeFieldButton(inputGroup, wikiGroupElements, index))
} }
inputGroup.appendChild(inputButton) inputGroup.appendChild(inputButton)
} }