[wp-trac] [WordPress Trac] #38550: Remove jQuery dependency from wp-custom-header.js
WordPress Trac
noreply at wordpress.org
Fri Oct 28 18:12:28 UTC 2016
#38550: Remove jQuery dependency from wp-custom-header.js
--------------------------+-------------------------
Reporter: joemcgill | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: javascript
--------------------------+-------------------------
Comment (by adamsilverstein):
Native events would be nice here... unfortunately ie8 requires some kludgy
workarounds.... Do we need to support
ie8?http://caniuse.com/#feat=addeventlistener
As far as I can see the listener for `wp-custom-header-video-loaded` is
only added in `twentyfourteen`, am I missing something? I was expecting it
in `twentyseventeen`
Do we really need to remove this dependency? twentyfourteen already loads
jQuery and uses it extensively in `functions.js`
I am attaching a patch that takes an alternate approach, exposing the `wp`
global to both closures and using a callback function. That's still a bit
clunky though and I am not convinced its a good idea.
When creating the patch I noticed that jQuery was not listed as a
dependency where wp-custom-headers.js is enqueued, to jQuery was getting
enqueued elsewhere. If jQuery is already a dependency for the context,
maybe we don't need to worry about removing it?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38550#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list