[wp-trac] [WordPress Trac] #38752: Twenty Seventeen: JavaScript coding standards
WordPress Trac
noreply at wordpress.org
Fri Nov 11 13:09:46 UTC 2016
#38752: Twenty Seventeen: JavaScript coding standards
---------------------------+--------------------
Reporter: afercia | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7
Component: Bundled Theme | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
---------------------------+--------------------
Comment (by afercia):
Expanding on @sstoqnov patch, I'd avoid code refactoring and just apply
some coding standards.
Worth noting couple things, even if they're outside the scope of this
ticket:
- some ternary and if/else seem not necessary to me, especially when
setting attributes, maybe code could be simplified a bit
- in `global.js` and `navigation.js`, maybe the functions called on window
resize could benefit from abstracting the function that sets the resize
timer and use a custom event, as 'wp-window-resized' does in the admin,
see `wp-admin/js/common.js`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38752#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list