( function( $ ) { // Site title and description. wp.customize( 'blogname', function( value ) { value.bind( function( to ) { console.log(to); $( '.site-title a' ).text( to ); } ); } ); wp.customize( 'blogdescription', function( value ) { value.bind( function( to ) { $( '.site-description' ).text( to ); } ); } ); wp.customize( 'capeone[header_full_width]', function( value ) { value.bind( function( to ) { if( to == '1' ) $( '.capeone-header' ).addClass( 'fullwidth' ); else $( '.capeone-header' ).removeClass( 'fullwidth' ); } ); } ); wp.customize( 'capeone[title_bar_layout]', function( value ) { value.bind( function( to ) { $( '.page-title-bar' ).removeClass( 'title-left title-right title-center title-left2 title-right2' ).addClass(to); } ); } ); wp.customize( 'capeone[display_topbar]', function( value ) { value.bind( function( to ) { if( to == '1' ){ $( '.capeone-top-bar' ).removeClass( 'hide' ); } else{ $( '.capeone-top-bar' ).addClass( 'hide' ); } } ); } ); wp.customize( 'capeone[display_footer_widgets]', function( value ) { value.bind( function( to ) { if( to == '1' ){ $( '.footer-widget-area' ).removeClass( 'hide' ); } else{ $( '.footer-widget-area' ).addClass( 'hide' ); } } ); } ); wp.customize( 'capeone[display_scroll_to_top]', function( value ) { value.bind( function( to ) { if( to == '1' ){ $( '.back-to-top' ).removeClass( 'hide' ); } else{ $( '.back-to-top' ).addClass( 'hide' ); } } ); } ); wp.customize( 'capeone[fullwidth_custom]', function( value ) { value.bind( function( to ) { if( to == '1' ){ $( '.fullwidth_custom_selective' ).removeClass( 'capeone-container' ).addClass('capeone-container-fullwidth'); } else{ $( '.fullwidth_custom_selective' ).addClass( 'capeone-container' ).removeClass('capeone-container-fullwidth'); } } ); } ); wp.customize( 'capeone[display_footer_icons]', function( value ) { value.bind( function( to ) { if( to == '1' ){ $( '.capeone-footer-sns' ).removeClass( 'hide' ); } else{ $( '.capeone-footer-sns' ).addClass( 'hide' ); } } ); } ); wp.customize( 'capeone[inline_header_menu_position]', function( value ) { value.bind( function( to ) { $( '.capeone-header' ).removeClass('left right center justify').addClass( to ); } ); } ); wp.customize( 'capeone[header_menu_hover_style]', function( value ) { value.bind( function( to ) { $( '.capeone-main-nav' ).removeClass('hoverline-fromcenter hoveroutline hoverbg').addClass( to ); } ); } ); wp.customize( 'capeone[transparent_header]', function( value ) { value.bind( function( to ) { if(to=='1') $( '.page-template-template-sections .capeone-header' ).addClass( 'transparent' ); else $( '.page-template-template-sections .capeone-header' ).removeClass( 'transparent' ); } ); } ); wp.customize( 'capeone[sticky_header]', function( value ) { value.bind( function( to ) { if(to=='1'){ $('.capeone-fixed-header-wrap').removeClass('hide'); }else{ $('.capeone-fixed-header-wrap').addClass('hide'); } } ); } ); $(document).on('click','.customize-partial-edit-shortcut-topbar_left_selective',function(){ wp.customize.preview.send( 'focus-control-for-setting', 'capeone[topbar_left]' ); }); $(document).on('click','.customize-partial-edit-shortcut-topbar_icons_selective',function(){ wp.customize.preview.send( 'focus-control-for-setting', 'capeone[topbar_icons]' ); }); $(document).on('click','.customize-partial-edit-shortcut-topbar_right_selective',function(){ wp.customize.preview.send( 'focus-control-for-setting', 'capeone[topbar_right]' ); }); $(document).on('click','.customize-partial-edit-shortcut-footer-info-area',function(){ wp.customize.preview.send( 'focus-control-for-setting', 'capeone[footer_icons]' ); }); } )( jQuery );