Themes: Exit `wp-custom-header.js` early in browsers wihout modern events.
Adds a check for `window.addEventListener` support before attempting to use it. In browsers without support, the file is exited early to avoid throwing a JavaScript error. Fixes #38585. git-svn-id: https://develop.svn.wordpress.org/trunk@39050 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4d115e4875
commit
3c97cbca24
|
@ -1,5 +1,10 @@
|
|||
(function( window, $, settings ) {
|
||||
|
||||
if ( ! ( 'addEventListener' in window ) ) {
|
||||
// Fail gracefully in unsupported browsers.
|
||||
return;
|
||||
}
|
||||
|
||||
function wpCustomHeader() {
|
||||
var handlers = {
|
||||
nativeVideo: {
|
||||
|
|
Loading…
Reference in New Issue