Merge "Fix TypeError: document.querySelectorAll(...).forEach is not a function"

This commit is contained in:
jenkins-bot 2022-01-10 20:59:09 +00:00 committed by Gerrit Code Review
commit 948f0392c9
1 changed files with 4 additions and 4 deletions

View File

@ -35,10 +35,10 @@ function bind() {
*/ */
function bindCloseOnUnload() { function bindCloseOnUnload() {
addEventListener( 'beforeunload', function () { addEventListener( 'beforeunload', function () {
document.querySelectorAll( CHECKBOX_HACK_CHECKBOX_SELECTOR + ':checked' ) var checkboxes = document.querySelectorAll( CHECKBOX_HACK_CHECKBOX_SELECTOR + ':checked' );
.forEach( function ( checkbox ) { Array.prototype.forEach.call( checkboxes, function ( checkbox ) {
/** @type {HTMLInputElement} */ ( checkbox ).checked = false; /** @type {HTMLInputElement} */ ( checkbox ).checked = false;
} ); } );
} ); } );
} }