[wp-trac] [WordPress Trac] #33428: Toggling customizer controls based on another control does not work anymore in 4.3

WordPress Trac noreply at wordpress.org
Wed Aug 19 09:45:47 UTC 2015


#33428: Toggling customizer controls based on another control does not work anymore
in 4.3
--------------------------+-----------------------------
 Reporter:  maimairel     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  4.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi,

 Since update v4.3, the toggling of customizer controls based on another
 customizer control does not work anymore. It works, but gets hidden
 immediately after the customizer finished loading.

 I checked the core code, and nothing has changed so it must be something
 else. It's this code that I'm talking about, in wp-admin/js/customize-
 controls.js

 {{{
 // Control visibility for default controls
 $.each({
         'background_image': {
                 controls: [ 'background_repeat', 'background_position_x',
 'background_attachment' ],
                 callback: function( to ) { return !! to; }
         },
         'show_on_front': {
                 controls: [ 'page_on_front', 'page_for_posts' ],
                 callback: function( to ) { return 'page' === to; }
         },
         'header_textcolor': {
                 controls: [ 'header_textcolor' ],
                 callback: function( to ) { return 'blank' !== to; }
         }
 }, function( settingId, o ) {
         api( settingId, function( setting ) {
                 $.each( o.controls, function( i, controlId ) {
                         api.control( controlId, function( control ) {
                                 var visibility = function( to ) {
                                         control.container.toggle(
 o.callback( to ) );
                                 };

                                 visibility( setting.get() );
                                 setting.bind( visibility );
                         });
                 });
         });
 });
 }}}

 Thank you :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33428>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list