* @copyright Copyright (c) 2017, Themeisle * @link http://themeisle.com/ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html */ if ( ! class_exists( 'WP_Customize_Control' ) ) { return; } /** * Scroll to section. * * @since 1.0 * @access public */ class Allo_Customize_Control_Scroll { /** * Allo_Customize_Control_Scroll constructor. */ public function __construct() { add_action( 'customize_controls_init', array( $this, 'enqueue' ) ); add_action( 'customize_preview_init', array( $this, 'helper_script_enqueue' ) ); } /** * The priority of the control. * * @since 1.0 * @var string */ public $priority = 0; /** * Loads the customizer script. * * @since 1.0 * @access public * @return void */ public function enqueue() { wp_enqueue_script( 'allo-scroller-script', TL_ALLO_TEMPLATE_DIR_URL . '/customizer/customizer-scroll/js/script.js', array( 'jquery' ), TL_ALLO_VERSION, true ); } /** * Enqueue the partials handler script that works synchronously with the allo-scroller-script */ public function helper_script_enqueue() { wp_enqueue_script( 'allo-scroller-addon-script', TL_ALLO_TEMPLATE_DIR_URL . '/customizer/customizer-scroll/js/customizer-addon-script.js', array( 'jquery' ), TL_ALLO_VERSION, true ); } }