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

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

	/*
	** Reusable Functions
	*/
		var optPrefix = '#customize-control-stylish_fashion_shop_options-';
		
		// Label
		function stylish_fashion_shop_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-stylish_fashion_shop_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'stylish_fashion_shop_scroll_hide' || id === 'stylish_fashion_shop_preloader_hide' || id === 'stylish_fashion_shop_sticky_header' || id === 'stylish_fashion_shop_products_per_row' || id === 'stylish_fashion_shop_woo_product_border_radius')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-stylish_fashion_shop_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Topbar Option

			if ( id === 'stylish_fashion_shop_topbar_phone_number' || id === 'stylish_fashion_shop_topbar_email' || id === 'stylish_fashion_shop_search_setting')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-stylish_fashion_shop_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Colors

			if ( id === 'stylish_fashion_shop_global_color' || id === 'stylish_fashion_shop_heading_color' || id === 'stylish_fashion_shop_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-stylish_fashion_shop_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Header Image

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

			//  Header

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

			//  Best Sells

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

			if ( id === 'stylish_fashion_shop_facebook_icon' || id === 'stylish_fashion_shop_twitter_icon' || id === 'stylish_fashion_shop_intagram_icon'|| id === 'stylish_fashion_shop_linkedin_icon'|| id === 'stylish_fashion_shop_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-stylish_fashion_shop_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Slider

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

			// Footer

			if ( id === 'stylish_fashion_shop_footer_bg_image' || id === 'stylish_fashion_shop_show_hide_copyright') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-stylish_fashion_shop_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
			// Post Setting

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

			// Single Post Setting

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


	/*
	** Tabs
	*/

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

		// General Setting
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_preloader_hide', 'Preloader' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_scroll_hide', 'Scroll To Top' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_sticky_header', 'Sticky Header' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_products_per_row', 'woocommerce Setting' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_woo_product_border_radius', 'Woocommerce Product Border Radius' );

		// Topbar Option
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_topbar_phone_number', 'Phone Number' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_topbar_email', 'Email Id' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_search_setting', 'Header Search' );

		// Social Icon
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_facebook_icon', 'Facebook' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_twitter_icon', 'Twitter' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_intagram_icon', 'Intagram' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_linkedin_icon', 'Linkedin' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_pintrest_icon', 'Pintrest' );

		// Colors
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_theme_color', 'Theme Color' );
		stylish_fashion_shop_customizer_label( 'background_color', 'Colors' );
		stylish_fashion_shop_customizer_label( 'background_image', 'Image' );

		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_global_color', 'Global Color' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_heading_color', 'Heading Typography' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_paragraph_color', 'Paragraph Typography' );

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

		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_post_layout', 'Post Layouts Settings' );

		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_404_page_main_heading', '404 Page Settings' );

		// Header
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_header_location_button', 'Location' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_topbar_phone_text', 'Phone Number' );

		// Best Sells
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_best_sells_section_heading', 'Exclusive Collection' );

		//Slider
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_slider_short_heading', 'Slider' );

		//Footer
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_footer_bg_image', 'Footer' );
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_show_hide_copyright', 'Copyright' );

		// Post Setting
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_post_page_title', 'Post Setting' );
	
		//Single Post Setting
		stylish_fashion_shop_customizer_label( 'stylish_fashion_shop_single_post_thumb', 'Single Post Setting' );
		
	}); // wp.customize ready

})( jQuery );
