/** * Update Customizer settings live. * * @version 1.0.0 */ ( function( $ ) { // Declare vars // Declare vars var api = wp.customize, body = $( 'body' ), siteHeader = $( '#site-header' ), visibility = [ 'all-devices', 'hide-tablet', 'hide-mobile', 'hide-tablet-mobile' ], menuPosition = [ 'left-menu', 'right-menu', 'center-menu' ], centerMenusPosition = [ 'wider', 'centered', 'closer' ], mediumMenuPosition = [ 'left-menu', 'right-menu', 'center-menu' ], verticalHeaderPosition = [ 'left-header', 'right-header', ], verticalHeaderLogoPosition = [ 'left-logo', 'center-logo', 'right-logo', ], tabletCol = [ 'tablet-1-col', 'tablet-2-col', 'tablet-3-col', 'tablet-4-col' ], mobileCol = [ 'mobile-1-col', 'mobile-2-col', 'mobile-3-col', 'mobile-4-col' ], blogThumbnailPosition = [ 'top', 'center', 'bottom' ], wooCatStyle = [ 'woo-default-cat', 'woo-dropdown-cat' ], wooAccountStyle = [ 'account-side-style', 'account-original-style' ], wooSaleStyle = [ 'square-sale', 'circle-sale' ], wooCartStyle = [ 'compact', 'spacious' ], wooProductsCol = [ '1', '2', '3', '4', '5', '6', '7' ], wooProductsTabletCol = [ 'tablet-1-col', 'tablet-2-col', 'tablet-3-col', 'tablet-4-col', 'tablet-5-col', 'tablet-6-col', 'tablet-7-col' ], wooProductsMobileCol = [ 'mobile-1-col', 'mobile-2-col', 'mobile-3-col', 'mobile-4-col', 'mobile-5-col', 'mobile-6-col', 'mobile-7-col' ], wooContentAlignment = [ 'owp-content-left', 'owp-content-right', 'owp-content-center' ], wooThumbsPosition = [ 'owp-thumbs-layout-horizontal', 'owp-thumbs-layout-vertical' ], wooAddToCartStyle = [ 'owp-btn-normal', 'owp-btn-big', 'owp-btn-very-big' ], wooTabsLayout = [ 'owp-tabs-layout-horizontal', 'owp-tabs-layout-vertical', 'owp-tabs-layout-section' ], wooTabsPosition = [ 'woo-left-tabs', 'woo-right-tabs', 'woo-center-tabs' ], wooCheckoutTimeline = [ 'arrow', 'square' ]; eddProductsCol = [ '1', '2', '3', '4' ], eddProductsTabletCol = [ 'tablet-1-col', 'tablet-2-col', 'tablet-3-col', 'tablet-4-col' ], eddProductsMobileCol = [ 'mobile-1-col', 'mobile-2-col', 'mobile-3-col', 'mobile-4-col' ], llmsCol = [ '1', '2', '3', '4', '5', '6' ], llmsTabletCol = [ 'tablet-1-col', 'tablet-2-col', 'tablet-3-col', 'tablet-4-col', 'tablet-5-col', 'tablet-6-col' ], llmsMobileCol = [ 'mobile-1-col', 'mobile-2-col', 'mobile-3-col', 'mobile-4-col', 'mobile-5-col', 'mobile-6-col' ], /******** General *********/ api( 'aces_theme_topbar_bg_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_theme_topbar_bg_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api( 'aces_topbar_border_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_border_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api("aces_theme_topbar_top_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_top_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_right_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_right_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_bottom_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_bottom_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_left_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_left_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_tablet_top_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_tablet_top_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_tablet_right_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_tablet_right_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_tablet_bottom_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_tablet_bottom_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_tablet_left_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_tablet_left_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_mobile_top_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_mobile_top_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_mobile_right_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_mobile_right_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_mobile_bottom_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_mobile_bottom_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); api("aces_theme_topbar_mobile_left_padding", function($swipe) { $swipe.bind(function(to) { var $child = $(".customizer-aces_theme_topbar_mobile_left_padding"); if (to) { /** @type {string} */ var style = '"; if ($child.length) { $child.replaceWith(style); } else { $("head").append(style); } } else { $child.remove(); } }); }); // Content api('aces_topbar_content_text', function( value ) { value.bind( function( newval ) { $( '.top-bar span.top-text' ).html( newval ); }); }); api( 'aces_topbar_contnt_text_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_contnt_text_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api( 'aces_topbar_contnt_link_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_contnt_link_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api( 'aces_topbar_contnt_link_hover_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_contnt_link_hover_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api( 'aces_topbar_menu_text_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_menu_text_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api( 'aces_topbar_menu_hover_text_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_menu_hover_text_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api( 'aces_topbar_social_icon_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_social_icon_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api( 'aces_topbar_social_icon_hover_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_social_icon_hover_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); api( 'aces_topbar_social_border_color', function( value ) { value.bind( function( to ) { var $child = $( '.customizer-aces_topbar_social_border_color' ); if ( to ) { var style = ''; if ( $child.length ) { $child.replaceWith( style ); } else { $( 'head' ).append( style ); } } else { $child.remove(); } } ); } ); } )( jQuery );