/*
** Scripts within the customizer controls window.
*/

(function( $ ) {
	wp.customize.bind( 'ready', function() {

	/*
	** Reusable Functions
	*/
		var optPrefix = '#customize-control-cooking_food_blogger_options-';
		
		// Label
		function cooking_food_blogger_customizer_label( id, title ) {

			// Site Identity

			if ( id === 'custom_logo' || id === 'site_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

			if ( id === 'cooking_food_blogger_theme_color' || id === 'background_color' || id === 'background_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'cooking_food_blogger_preloader_hide' || id === 'cooking_food_blogger_sticky_header' || id === 'cooking_food_blogger_scroll_hide' || id === 'cooking_food_blogger_products_per_row' || id === 'cooking_food_blogger_woocommerce_product_sale' || id === 'cooking_food_blogger_woo_product_border_radius') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Header Image

			if ( id === 'header_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header

			if ( id === 'cooking_food_blogger_header_setting' || id === 'cooking_food_blogger_email' || id === 'cooking_food_blogger_phone_number' || id === 'cooking_food_blogger_button_text' || id === 'cooking_food_blogger_search_setting') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Slider

			if ( id === 'cooking_food_blogger_slider_setting' || id === 'cooking_food_blogger_social_icon_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Our Services

			if ( id === 'cooking_food_blogger_services_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Footer

			if ( id === 'cooking_food_blogger_show_hide_footer' || id === 'cooking_food_blogger_show_hide_copyright') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Page Setting

			if ( id === 'cooking_food_blogger_single_page_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Single Post Setting

			if ( id === 'cooking_food_blogger_single_post_thumb' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Single Post Comment Setting

			if ( id === 'cooking_food_blogger_single_post_comment_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Post Setting

			if ( id === 'cooking_food_blogger_post_page_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-cooking_food_blogger_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
		}


	/*
	** Tabs
	*/
         
        // Site Identity
		cooking_food_blogger_customizer_label( 'custom_logo', 'Logo Setup' );
		cooking_food_blogger_customizer_label( 'site_icon', 'Favicon' );

		// Colors
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_theme_color', 'Theme Color' );
		cooking_food_blogger_customizer_label( 'background_color', 'Colors' );
		cooking_food_blogger_customizer_label( 'background_image', 'Image' );

	    // General Setting
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_preloader_hide', 'Preloader' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_sticky_header', 'Sticky Header' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_scroll_hide', 'Scroll To Top' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_products_per_row', 'Woocommerce Settings' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_woocommerce_product_sale', 'Woocommerce Product Sale' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_woo_product_border_radius', 'Woocommerce Product Border Radius' );

		//Header Image
		cooking_food_blogger_customizer_label( 'header_image', 'Header Image' );

		// Header
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_header_setting', 'Header Text ' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_email', 'Email' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_phone_number', 'Phone' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_search_setting', 'Search' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_button_text', 'Button' );

		//Slider
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_slider_setting', 'Slider' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_social_icon_setting', 'Social Icon' );

		// Our Services
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_services_setting', 'Our Services' );

		//Footer
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_show_hide_footer', 'Footer' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_show_hide_copyright', 'Copyright' );

		//Single Post Setting
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_single_post_thumb', 'Single Post Setting' );
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_single_post_comment_title', 'Single Post Comment' );

		// Post Setting
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_post_page_title', 'Post Setting' );

		// Page Setting
		cooking_food_blogger_customizer_label( 'cooking_food_blogger_single_page_title', 'Page Setting' );
	

	}); // wp.customize ready

})( jQuery );
