<?php
/**
 * Loader options
 *
 * @package Theme Palace
 * @subpackage  Pushpa
 * @since  Pushpa 1.0.0
 */

$wp_customize->add_section( 'pushpa_loader',
	array(
		'title'            	=> esc_html__( 'Loader','pushpa' ),
		'description'      	=> esc_html__( 'Loader section options.', 'pushpa' ),
		'panel'            	=> 'pushpa_theme_options_panel',
	)
);

// Loader enable setting and control.
$wp_customize->add_setting( 'pushpa_theme_options[loader_enable]',
	array(
		'sanitize_callback' => 'pushpa_sanitize_switch_control',
		'default'           => $options['loader_enable'],
	)
);

$wp_customize->add_control(  new  pushpa_Switch_Control( $wp_customize,
	'pushpa_theme_options[loader_enable]',
		array(
			'label'            	=> esc_html__( 'Enable loader', 'pushpa' ),
			'section'          	=> 'pushpa_loader',
			'on_off_label' 		=> pushpa_switch_options(),
		)
	)
);

// Loader icons setting and control.
$wp_customize->add_setting( 'pushpa_theme_options[loader_icon]',
	array(
		'sanitize_callback' => 'pushpa_sanitize_select',
		'default'			=> $options['loader_icon'],
	)
);

$wp_customize->add_control( 'pushpa_theme_options[loader_icon]',
	array(
		'label'           	=> esc_html__( 'Icon', 'pushpa' ),
		'section'         	=> 'pushpa_loader',
		'type'				=> 'select',
		'choices'			=> pushpa_get_spinner_list(),
		'active_callback' 	=> 'pushpa_is_loader_enable',
	)
);
