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 Dec 6, 2021
1 parent 994692c commit f3f980f
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 f3f980f

Please sign in to comment.