Skip to content

Commit

Permalink
Switch to addEventListener for load event in the navigation block vie…
Browse files Browse the repository at this point in the history
…w script (#37135)
  • Loading branch information
talldan authored and noisysocks committed Dec 13, 2021
1 parent e5d4813 commit 4c315dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function toggleSubmenuOnClick( event ) {

// Necessary for some themes such as TT1 Blocks, where
// scripts could be loaded before the body.
window.onload = () => {
window.addEventListener( 'load', () => {
MicroModal.init( {
onShow: navigationToggleModal,
onClose: navigationToggleModal,
Expand Down Expand Up @@ -95,4 +95,4 @@ window.onload = () => {
}
} );
} );
};
} );

0 comments on commit 4c315dc

Please sign in to comment.