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:
		
							parent
							
								
									26bcafcbb5
								
							
						
					
					
						commit
						66c79f7d55
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -155,7 +155,7 @@ function init_button_with_confirm() | |||
|         data-cancel: Text inside the cancel button. Default is "Cancel". | ||||
|         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) | ||||
|     { | ||||
|         var button = buttons[index]; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue