[wp-trac] [WordPress Trac] #30277: Split up Customizer JS into separate files and remove self-booting jQuery.ready call
WordPress Trac
noreply at wordpress.org
Thu Nov 6 20:11:46 UTC 2014
#30277: Split up Customizer JS into separate files and remove self-booting
jQuery.ready call
----------------------------+-------------------------
Reporter: westonruter | Owner:
Type: task (blessed) | Status: new
Priority: normal | Milestone: 4.1
Component: Customize | Version: trunk
Severity: normal | Keywords: needs-patch
Focuses: javascript |
----------------------------+-------------------------
The `customize-controls.js` file is huge and is named incorrectly now with
#28709 and the fleshed-out models for Panels and Sections. The file should
be broken up into `customize-sections.js`, `customize-panels.js`, and
`customize-utils.js`. The last of which should include the private
function exposed as public methods off of `wp.customize.utils`. This may
also include the `wp.customize.init()` mentioned in #29071. We need to
stop booting the Customizer inside of these JS libraries with a direct
`jQuery.ready` call, and instead let the including page invoke that. This
is critical for code reusability and for unit testing. For instance, the
`customize.php` page could do in the footer:
{{{#!php
<script>
jQuery(function () {
wp.customize.init( _wpCustomizeSettings );
});
</script>
}}}
For `wp.customize.utils`, see existing patch at: https://github.com/xwp
/wordpress-develop/pull/47
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30277>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list