[wp-trac] [WordPress Trac] #34391: Harden panel/section UI code by removing contents from being logically nested (read: goodbye margin-top hacks)

WordPress Trac noreply at wordpress.org
Fri Sep 16 13:22:25 UTC 2016


#34391: Harden panel/section UI code by removing contents from being logically
nested (read: goodbye margin-top hacks)
-------------------------------------+-------------------------------------
 Reporter:  westonruter              |       Owner:  delawski
     Type:  defect (bug)             |      Status:  assigned
 Priority:  normal                   |   Milestone:  4.7
Component:  Customize                |     Version:  4.0
 Severity:  normal                   |  Resolution:
 Keywords:  early has-patch dev-     |     Focuses:  ui, accessibility,
  feedback                           |  javascript
-------------------------------------+-------------------------------------

Comment (by delawski):

 I've been working recently on refactoring of my original solution.

 - `container` is now a set of two jQuery objects as suggested by
 @westonruter (https://wordpress.slack.com/archives/core-
 customize/p1473792730000673). This way the backwards compatibility should
 be better, as most of jQuery's methods like `find()` should still work
 well with new panel/section structure.
 - Introduced two new properties to the `Container`, namely:
 `headContainer` which stores the head or label of the panel/section and
 `contentContainer` which stores the content area of the section/panel
 (usually `ul`).
 - Abstracted `_animateChangeExpanded()` method so that there is no code
 duplication now.
 - Moved code responsible for screen flickering prevention to the
 `_animateChangeExpanded()` method.
 - Removed all unnecessary minor changes in the code, so that the patch
 itself is more consistent.

 Here's the diff:
 https://core.trac.wordpress.org/attachment/ticket/34391/34391_4.diff

 Next, I'm planning to test the patch with @celloexpressions's #37661.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34391#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list