Changeset 12197
- Timestamp:
- 07/26/2018 03:47:11 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/js/customizer.js
r12082 r12197 5 5 ( function( wp, $ ) { 6 6 7 if ( undefined === typeof wp.customizer) {7 if ( 'undefined' === typeof wp.customize ) { 8 8 return; 9 9 } 10 10 11 $( document ).ready( function() { 11 wp.customize.bind( 'ready', function() { 12 var groupFrontPage = wp.customize.control( 'group_front_page' ), 13 userFrontPage = wp.customize.control( 'user_front_page' ); 12 14 13 15 // If the Main Group setting is disabled, hide all others 14 $( wp.customize.control( 'group_front_page' ).selector ).on( 'click', 'input[type=checkbox]', function( event ) { 15 var checked = $( event.currentTarget ).prop( 'checked' ), controller = $( event.delegateTarget ).prop( 'id' ); 16 if ( 'undefined' !== typeof groupFrontPage ) { 17 $( groupFrontPage.selector ).on( 'click', 'input[type=checkbox]', function( event ) { 18 var checked = $( event.currentTarget ).prop( 'checked' ), controller = $( event.delegateTarget ).prop( 'id' ); 16 19 17 _.each( wp.customize.section( 'bp_nouveau_group_front_page' ).controls(), function( control ) { 18 if ( control.selector !== '#' + controller ) { 19 if ( true === checked ) { 20 $( control.selector ).show(); 21 } else { 22 $( control.selector ).hide(); 20 _.each( wp.customize.section( 'bp_nouveau_group_front_page' ).controls(), function( control ) { 21 if ( control.selector !== '#' + controller ) { 22 if ( true === checked ) { 23 $( control.selector ).show(); 24 } else { 25 $( control.selector ).hide(); 26 } 23 27 } 24 } 28 } ); 25 29 } ); 26 } );30 } 27 31 28 32 // If the Main User setting is disabled, hide all others 29 $( wp.customize.control( 'user_front_page' ).selector ).on( 'click', 'input[type=checkbox]', function( event ) { 30 var checked = $( event.currentTarget ).prop( 'checked' ), controller = $( event.delegateTarget ).prop( 'id' ); 33 if ( 'undefined' !== typeof userFrontPage ) { 34 $( userFrontPage.selector ).on( 'click', 'input[type=checkbox]', function( event ) { 35 var checked = $( event.currentTarget ).prop( 'checked' ), controller = $( event.delegateTarget ).prop( 'id' ); 31 36 32 _.each( wp.customize.section( 'bp_nouveau_user_front_page' ).controls(), function( control ) { 33 if ( control.selector !== '#' + controller ) { 34 if ( true === checked ) { 35 $( control.selector ).show(); 36 } else { 37 $( control.selector ).hide(); 37 _.each( wp.customize.section( 'bp_nouveau_user_front_page' ).controls(), function( control ) { 38 if ( control.selector !== '#' + controller ) { 39 if ( true === checked ) { 40 $( control.selector ).show(); 41 } else { 42 $( control.selector ).hide(); 43 } 38 44 } 39 } 45 } ); 40 46 } ); 41 } );47 } 42 48 43 49 $( 'ul#customize-control-group_nav_order, ul#customize-control-user_nav_order' ).sortable( { … … 60 66 } 61 67 } ).disableSelection(); 62 63 68 } ); 64 69
Note: See TracChangeset
for help on using the changeset viewer.