#42867 closed defect (bug) (fixed)
HTML Widget: toggleClass() should be passed true/false as second param
Reported by: | iCaleb | Owned by: | westonruter |
---|---|---|---|
Milestone: | 4.9.2 | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Widgets | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
http://api.jquery.com/toggleclass/
It expects either true or false for the second parameter, passing an integer will just toggle on/off which is sometimes not the desired result.
Found the problem here: https://github.com/WordPress/WordPress/blob/4.9-branch/wp-admin/js/widgets/custom-html-widgets.js#L207, with correct usage found here: https://github.com/WordPress/WordPress/blob/4.9-branch/wp-admin/js/theme-plugin-editor.js#L365
Attachments (1)
Change History (8)
This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.
6 years ago
#5
in reply to:
↑ description
@
6 years ago
Note: See
TracTickets for help on using
tickets.
Replying to iCaleb:
Confirmed,
toggleClass( ..., 0 )
is not the same astoggleClass( ..., false )
, and just acts as a regular toggle. Likewise,toggleClass( ..., 1 )
is not the same astoggleClass( ..., true )
.