/*
* All copyright @FuduTheme 2019 Develope by FuduTheme Team
*/
jQuery.noConflict();
/** Fire up jQuery - let's dance! */
jQuery(document).ready(function($) {
/* Theme color section name*/
jQuery('#customize-control-btn_primary_bg_color_setting').prepend('
Primary Button
');
jQuery('#customize-control-section_heading_font_family_setting').prepend('Section Headings
');
jQuery('#customize-control-heading_font_family_setting').prepend('Title Headings
');
jQuery('#customize-control-control_home_section_1_display').prepend(''+fuduthemeL10n.sliderlink+'
');
jQuery('#customize-control-control_home_section_2_display').prepend(''+fuduthemeL10n.featurelink+'
');
jQuery('#customize-control-control_home_section_5_display').prepend(''+fuduthemeL10n.serviceslink+'
');
jQuery('#customize-control-control_home_section_6_display').prepend(''+fuduthemeL10n.ourteamlink+'
');
jQuery('#customize-control-control_home_section_7_display').prepend(''+fuduthemeL10n.testimoniallink+'
');
jQuery('#customize-control-control_home_section_8_display').prepend(''+fuduthemeL10n.pricinglink+'
');
jQuery('#customize-control-control_home_section_9_display').prepend(''+fuduthemeL10n.bloglink+'
');
jQuery('#customize-control-control_home_section_1_slider_loop').prepend('Slider Settings
');
jQuery('#customize-control-control_home_section_6_team_no_of_record').prepend('Slider Settings
');
jQuery('#customize-control-control_home_section_7_testimonial_no_of_record').prepend('Slider Settings
');
jQuery('#customize-control-control_home_section_1_slider_bg_color').prepend('Basic Settings
');
jQuery('#customize-control-control_home_section_3_about_tagline').prepend('Basic Settings
');
jQuery('#customize-control-control_home_section_4_counter_bg_image').prepend('Basic Settings
');
jQuery('#customize-control-control_home_section_5_services_tagline').prepend('Basic Settings
');
jQuery('#customize-control-control_home_section_7_testimonial_blockquote_icon').prepend('Basic Settings
');
jQuery('#customize-control-control_home_section_9_news_no_of_records').prepend('Basic Settings
');
jQuery('#customize-control-control_home_section_8_pricing_tagline').prepend('Basic Settings
');
jQuery('#customize-control-footer_show_1st_column').prepend('1st Column Settings
');
jQuery('#customize-control-footer_show_2nd_column_setting').prepend('2nd Column Settings
');
jQuery('#customize-control-footer_show_3rd_column_setting').prepend('3rd Column Settings
');
jQuery('#customize-control-footer_show_4th_column_setting').prepend('4th Column Settings
');
jQuery('#customize-control-footer_show_5th_column_setting').prepend('5th Column Settings
');
jQuery('#customize-control-fst_request_section1_text').prepend('Section 1 Settings
');
jQuery('#customize-control-fst_request_section2_text').prepend('Section 2 Settings
');
/* For Customizer Hide/Show options */
jQuery("[hideshow='true']").each(function() {
var selector_id = jQuery(this).attr("id");
if( selector_id && selector_id != '' ) {
var val = jQuery("#"+selector_id).val();
var target_id = selector_id+"-slide";
var hide_ids = [];
jQuery("[hideshow_parent='"+target_id+"']").each(function() {
var ids = jQuery(this).parent().attr('id');
hide_ids.push(ids);
if( val == 'slide' || val == 'yes' || val == 'show') {
jQuery("#"+ids).show();
jQuery("."+ids).show();
} else {
jQuery("#"+ids).hide();
jQuery("."+ids).hide();
}
});
jQuery("#"+selector_id).change(function(){
var val = jQuery(this).val();
jQuery("#"+selector_id+"-link").val(val).change();
jQuery(hide_ids).each(function(index, id) {
if( val == 'slide' || val == 'yes' || val == 'show' ) {
jQuery("#"+id).show();
jQuery("."+id).show();
} else {
jQuery("#"+id).hide();
jQuery("."+id).hide();
}
});
});
}
});
/* for footer 1st column if shown by section */
var footer_section_ids = "#customize-control-footer1_title_setting, #customize-control-footer1_content, #customize-control-footer1_first_icon_setting, #customize-control-footer1_address, #customize-control-footer1_4th_icon_setting, #customize-control-footer1_website, #customize-control-footer1_second_icon_setting, #customize-control-footer1_phone";
jQuery("input[name='_customize-radio-footer_show_1st_column']").change(function(){
var footer_column_one = jQuery(this).val();
if (footer_column_one == 'section') {
jQuery(footer_section_ids).show();
} else {
jQuery(footer_section_ids).hide();
}
});
jQuery(document).ready(function(){
var footer_column_one = jQuery("input[name='_customize-radio-footer_show_1st_column']:checked").val();
if (footer_column_one == 'section') {
jQuery(footer_section_ids).show();
} else {
jQuery(footer_section_ids).hide();
}
});
/* for footer 2nd column if shown by section */
jQuery("input[name='_customize-radio-footer_show_2nd_column']").change(function() {
var footer_column_two = jQuery(this).val();
if (footer_column_two == 'section') {
jQuery("#customize-control-footer_show_2nd_column_title").show();
} else {
jQuery("#customize-control-footer_show_2nd_column_title").hide();
}
});
jQuery(document).ready(function(){
var footer_column_two = jQuery("input[name='_customize-radio-footer_show_2nd_column']:checked").val();
if (footer_column_two == 'section') {
jQuery("#customize-control-footer_show_2nd_column_title").show();
} else {
jQuery("#customize-control-footer_show_2nd_column_title").hide();
}
});
/* for footer 3rd column if shown by section */
jQuery("input[name='_customize-radio-footer_show_3rd_column']").change(function(){
var footer_column_three = jQuery(this).val();
if (footer_column_three == 'section') {
jQuery("#customize-control-footer_show_3rd_column_title").show();
} else {
jQuery("#customize-control-footer_show_3rd_column_title").hide();
}
});
jQuery(document).ready(function(){
var footer_column_three = jQuery("input[name='_customize-radio-footer_show_3rd_column']:checked").val();
if (footer_column_three == 'section') {
jQuery("#customize-control-footer_show_3rd_column_title").show();
} else {
jQuery("#customize-control-footer_show_3rd_column_title").hide();
}
});
/* for footer 4th column if shown by section */
$footer_settings = "#customize-control-footer_show_4th_column_title ,#customize-control-footer_show_4th_column_subscription_form, #customize-control-show_social_icon_settings, #customize-control-social_icon_color_setting, #customize-control-social_icon_hover_color_setting, #customize-control-social_icon_font_size_setting, #customize-control-fb_link, #customize-control-twitter_link, #customize-control-pinterest_link, #customize-control-linked_in_link, #customize-control-google_plus, #customize-control-instagram_link";
jQuery("input[name='_customize-radio-footer_show_4th_column']").change(function(){
var footer_column_4th = jQuery(this).val();
if (footer_column_4th == 'section') {
jQuery($footer_settings).show();
} else {
jQuery($footer_settings).hide();
}
});
jQuery(document).ready(function(){
var footer_column_4th = jQuery("input[name='_customize-radio-footer_show_4th_column']:checked").val();
if (footer_column_4th == 'section') {
jQuery($footer_settings).show();
} else {
jQuery($footer_settings).hide();
}
});
/* for footer 5th column if shown by section */
jQuery("input[name='_customize-radio-footer_show_5th_column']").change(function(){
var footer_column_5th = jQuery(this).val();
if (footer_column_5th == 'section') {
jQuery($footer_settings).show();
} else {
jQuery($footer_settings).hide();
}
});
jQuery(document).ready(function(){
var footer_column_5th = jQuery("input[name='_customize-radio-footer_show_5th_column']:checked").val();
if (footer_column_5th == 'section') {
jQuery($footer_settings).show();
} else {
jQuery($footer_settings).hide();
}
});
});
( function( $ ) {
if($( wp.customize ).length > 0) {
wp.customize.bind( 'ready', function() {
$( '#sub-accordion-panel-front_panel li' ).each(function(key,value) {
var fst_id = this.id ;
var split_sec_id = fst_id.split("-");
var section_name = split_sec_id[2];
if (section_name) {
var split_val = section_name.split('_');
var sec_highlight = split_val[3];
wp.customize.section( section_name, function( section ) {
section.expanded.bind( function( isExpanding ) {
wp.customize.previewer.send( 'section-highlight-fst_'+section_name, { expanded: isExpanding, sec_highlight:section_name } );
} );
} );
}
} );
wp.customize.panel( "footer_panel", function( section ) {
section.expanded.bind( function( isExpanding ) {
wp.customize.previewer.send( 'footer_panel', { expanded: isExpanding } );
} );
} );
wp.customize.panel( 'front_panel', function( panel ) {
var previousUrl, clearPreviousUrl, previewUrlValue;
previewUrlValue = wp.customize.previewer.previewUrl;
clearPreviousUrl = function() {
previousUrl = null;
};
panel.expanded.bind( function( isExpanded ) {
var url;
if ( isExpanded ) {
url = wp.customize.settings.url.home;
previousUrl = previewUrlValue.get();
previewUrlValue.set( url );
previewUrlValue.bind( clearPreviousUrl );
wp.customize.previewer.previewUrl(url);
if (url != previousUrl) {
wp.customize.previewer.refresh();
}
} else {
previewUrlValue.unbind( clearPreviousUrl );
if ( previousUrl ) {
previewUrlValue.set( previousUrl );
}
}
} );
} );
} );
}
} )( jQuery );
/************* Drag and Drop of customizer section **************/
/* For Color Option */
jQuery(document).ready(function(){
var normal_color = "#customize-control-btn_primary_bg_normal_color_setting";
var gradient_color = "#customize-control-btn_primary_bg_color1_setting, #customize-control-btn_primary_bg_color2_setting";
jQuery("#_customize-input-button_color_option").change(function(){
var color_option = jQuery(this).val();
if (color_option == 'normal') {
jQuery(normal_color).show();
jQuery(gradient_color).hide();
} else {
jQuery(normal_color).hide();
jQuery(gradient_color).show();
}
});
var color_option = jQuery("#_customize-input-button_color_option").val();
if (color_option == 'normal') {
jQuery(normal_color).show();
jQuery(gradient_color).hide();
} else {
jQuery(normal_color).hide();
jQuery(gradient_color).show();
}
});
jQuery( document ).ready(function() {
if (jQuery( "#sub-accordion-panel-front_panel" ).length>0) {
jQuery( "#sub-accordion-panel-front_panel" ).sortable({
update: function(event, ui) {
if(confirm("For this feature, Click on Ok and Get pro version")){
window.open( fuduthemeL10n.pro_url,'_blank' );
} else{
return false;
}
}
});
}
});