[wp-trac] [WordPress Trac] #28709: Improve/introduce Customizer JS models for Controls, Sections, and Panels

WordPress Trac noreply at wordpress.org
Sun Oct 19 07:54:44 UTC 2014


#28709: Improve/introduce Customizer JS models for Controls, Sections, and Panels
------------------------------------+-------------------------
 Reporter:  westonruter             |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  high                    |   Milestone:  4.1
Component:  Customize               |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  javascript
------------------------------------+-------------------------

Comment (by westonruter):

 For an example of what this new API now facilitates:

 if you are inside of an expanded panel, and you inactivate all sections
 within it, for example:

 {{{#!js
 _( wp.customize.panel( 'widgets' ).sections() ).each( function ( section )
 {
     section.active( false );
 } );
 }}}

 Then it will automatically collapse the panel and slide up the accordion
 section title so that it can no longer be accessed.

 Also, if you re-assign all controls from one section to another, the
 former section will automatically appear as deactivated (it will hide)
 because it is contextually inactive (it has no controls that are active).
 Moving all controls from a "colors" section to a "styles" section, also
 resulting in the colors section being collapsed and hidden:

 {{{#!js
 _( wp.customize.section( 'colors' ).controls() ).each( function ( control
 ) {
     control.section( 'styles' );
 } );
 }}}

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


More information about the wp-trac mailing list