Use separate array of buttons to prevent index skipping.

I didn't know that the HTMLCollection would dynamically update,
and removing the class from the button would take them out
of the collection.
This commit is contained in:
voussoir 2019-06-15 13:49:33 -07:00
parent 26bcafcbb5
commit 66c79f7d55

View file

@ -155,7 +155,7 @@ function init_button_with_confirm()
data-cancel: Text inside the cancel button. Default is "Cancel". data-cancel: Text inside the cancel button. Default is "Cancel".
data-cancel-class data-cancel-class
*/ */
var buttons = document.getElementsByClassName("button_with_confirm"); var buttons = Array.from(document.getElementsByClassName("button_with_confirm"));
for (var index = 0; index < buttons.length; index += 1) for (var index = 0; index < buttons.length; index += 1)
{ {
var button = buttons[index]; var button = buttons[index];