WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 6 months ago

#24988 new enhancement

Cleanup for `/wp-admin/js/accordion.js`

Reported by: carldanley Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.8
Component: General Keywords: has-patch
Focuses: javascript Cc:

Description

I've attached a cleanup iteration of the existing accordion file.

  • Cleaner function names
  • Moved the structure of the file to a revealing module pattern
  • Added JSDocs
  • prefixed jQuery objects with proper $ sign
  • The current iteration has no publicly exposed API methods but I was thinking it might be nice to offer support for toggleAccordion etc. Need thoughts on this.

Could use a second pair of eyes to test this functionality and make sure we have no errors here.

Attachments (1)

accordion-cleanup.diff (5.1 KB) - added by carldanley 11 months ago.

Download all attachments as: .zip

Change History (3)

comment:1 DrewAPicture11 months ago

  • Keywords has-patch added
  • Type changed from defect (bug) to enhancement

Looks like accordion-cleanup.diff is a good start. Would you mind adding a file header? I believe we added this in the last cycle (3.6).

comment:2 jeremyfelt6 months ago

  • Focuses javascript added
Note: See TracTickets for help on using tickets.