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

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

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

			// Colors

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

			// Site Identity

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

			// Global Color Setting

			if ( id === 'fashion_blogs_theme_color' || id === 'fashion_blogs_heading_color' || id === 'fashion_blogs_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-fashion_blogs_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Top Header

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

			// General Setting

			if ( id === 'fashion_blogs_preloader_hide' || id === 'fashion_blogs_sticky_header' || id === 'fashion_blogs_scroll_hide'  || id === 'fashion_blogs_woocommerce_shop_page_sidebar' || id === 'fashion_blogs_woocommerce_product_sale' || id === 'fashion_blogs_woo_product_border_radius') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-fashion_blogs_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Social Icon

			if ( id === 'fashion_blogs_facebook_icon' || id === 'fashion_blogs_twitter_icon' || id === 'fashion_blogs_intagram_icon'|| id === 'fashion_blogs_linkedin_icon'|| id === 'fashion_blogs_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-fashion_blogs_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			// Slider

			if ( id === 'fashion_blogs_slide_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-fashion_blogs_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-fashion_blogs_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
			// Latest Post

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

			// Footer

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

			// Single Post Setting

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

			// Single Post Comment Setting

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

			// Post Setting

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

			// Page Setting

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


	/*
	** Tabs
	*/

		// Colors
		fashion_blogs_customizer_label( 'background_color', 'Colors' );
		fashion_blogs_customizer_label( 'background_image', 'Image' );

		// Site Identity
		fashion_blogs_customizer_label( 'custom_logo', 'Logo Setup' );
		fashion_blogs_customizer_label( 'site_icon', 'Favicon' );

		// Global Color Setting
		fashion_blogs_customizer_label( 'fashion_blogs_theme_color', 'Global Color' );
		fashion_blogs_customizer_label( 'fashion_blogs_heading_color', 'Heading Typography' );
		fashion_blogs_customizer_label( 'fashion_blogs_paragraph_color', 'Paragraph Typography' );

		// Top Header
		fashion_blogs_customizer_label( 'fashion_blogs_subscribe_text', 'Subscribe Button' );
		fashion_blogs_customizer_label( 'fashion_blogs_topbar_text', 'Header Text' );

		// General Setting
		fashion_blogs_customizer_label( 'fashion_blogs_preloader_hide', 'Preloader' );
		fashion_blogs_customizer_label( 'fashion_blogs_sticky_header', 'Sticky Header' );
		fashion_blogs_customizer_label( 'fashion_blogs_scroll_hide', 'Scroll To Top' );
		fashion_blogs_customizer_label( 'fashion_blogs_woocommerce_shop_page_sidebar', 'Woocommerce Settings' );
		fashion_blogs_customizer_label( 'fashion_blogs_woocommerce_product_sale', 'Woocommerce Product Sale Positions' );
		fashion_blogs_customizer_label( 'fashion_blogs_woo_product_border_radius', 'Woocommerce Product Border Radius' );

		// Social Icon
		fashion_blogs_customizer_label( 'fashion_blogs_facebook_icon', 'Facebook' );
		fashion_blogs_customizer_label( 'fashion_blogs_twitter_icon', 'Twitter' );
		fashion_blogs_customizer_label( 'fashion_blogs_intagram_icon', 'Intagram' );
		fashion_blogs_customizer_label( 'fashion_blogs_linkedin_icon', 'Linkedin' );
		fashion_blogs_customizer_label( 'fashion_blogs_pintrest_icon', 'Pintrest' );

		//Slider
		fashion_blogs_customizer_label( 'fashion_blogs_slide_setting', 'Slider' );

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

		//Latest Post
		fashion_blogs_customizer_label( 'fashion_blogs_latest_post_setting', 'Latest Post' );

		//Footer
		fashion_blogs_customizer_label( 'fashion_blogs_footer_bg_image', 'Footer' );
		fashion_blogs_customizer_label( 'fashion_blogs_show_hide_copyright', 'Copyright' );

		//Single Post Setting
		fashion_blogs_customizer_label( 'fashion_blogs_single_post_thumb', 'Single Post Setting' );
		fashion_blogs_customizer_label( 'fashion_blogs_single_post_comment_title', 'Single Post Comment' );

		// Post Setting
		fashion_blogs_customizer_label( 'fashion_blogs_post_page_title', 'Post Setting' );

		// Page Setting
		fashion_blogs_customizer_label( 'fashion_blogs_single_page_title', 'Page Setting' );

	}); // wp.customize ready

})( jQuery );
