#42867 closed defect (bug) (fixed)
HTML Widget: toggleClass() should be passed true/false as second param
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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)
#1
@Presskopp
3 months ago
- Keywords has-patch needs-testing added
#2
@westonruter
2 months ago
- Milestone changed from Awaiting Review to 4.9.2
- Version changed from trunk to 4.9
This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.
8 weeks ago
#4
@westonruter
8 weeks ago
- Owner set to westonruter
- Status changed from new to reviewing
#5
in reply to:
↑ description
@SergeyBiryukov
8 weeks ago
#6
@SergeyBiryukov
8 weeks ago
- Resolution set to fixed
- Status changed from reviewing to closed
In 42457:
#7
@SergeyBiryukov
8 weeks ago
In 42458:
Note: See
TracTickets for help on using
tickets.
Replying to iCaleb:
Confirmed, toggleClass( ..., 0 ) is not the same as toggleClass( ..., false ), and just acts as a regular toggle. Likewise, toggleClass( ..., 1 ) is not the same as toggleClass( ..., true ).