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

$wp_customize->add_section( 'enlightme_pro_loader', array(
	'title'            		=> esc_html__( 'Loader','enlightme-pro' ),
	'description'      		=> esc_html__( 'Loader section options.', 'enlightme-pro' ),
	'panel'            		=> 'enlightme_pro_theme_options_panel',
) );

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

$wp_customize->add_control(  new Enlightme_Pro_Switch_Control( $wp_customize, 'enlightme_pro_theme_options[loader_enable]', array(
	'label'               	=> esc_html__( 'Enable loader', 'enlightme-pro' ),
	'section'             	=> 'enlightme_pro_loader',
	'on_off_label' 		=> enlightme_pro_switch_options(),
) ) );

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

$wp_customize->add_control( 'enlightme_pro_theme_options[loader_icon]', array(
	'label'           		=> esc_html__( 'Icon', 'enlightme-pro' ),
	'section'         		=> 'enlightme_pro_loader',
	'type'					=> 'select',
	'choices'				=> enlightme_pro_get_spinner_list(),
	'active_callback' 		=> 'enlightme_pro_is_loader_enable',
) );
