[wp-trac] [WordPress Trac] #32911: Review Customizer Nav Menus JS
WordPress Trac
noreply at wordpress.org
Tue Jul 7 22:10:52 UTC 2015
#32911: Review Customizer Nav Menus JS
----------------------------+-------------------
Reporter: wonderboymusic | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.3
Component: Customize | Version: trunk
Severity: normal | Keywords:
Focuses: javascript |
----------------------------+-------------------
A few notes:
* The `$.Deferred` is unnecessary - when resolved, it just calls init,
which adds another callback to the stack, which then gets called next. All
of these can be combined into one.
* `self` is a bad local variable name. Sometimes `self` is a substitute
for `this` when scope is lost in a maze of callbacks, but most of the
time, it just makes `this` more ambiguous than it already is.
* Almost all of these functions are static helper methods, do any of them
need to exposed publicly? We have gotten into a bad habit of globalizing
all of our JS, which has made BC a living hell when we want to use things
like `browserify`. I would expose as little as possible everywhere.
* We should distinguish between settings and class/instance properties.
The patch makes this JS look more like the other Customizer JS. I am not
going to drop it in right now. I may have to wait until all of the
Customizer turbulence is over and then do one cleanup.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32911>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list