Astra_Menu_Sidebar_Animation::add_scripts()
Add common js scripts for Flyout, Canvas Sidebar, Fullscreen menu.
Description
Return
(void)
Source
File: classes/modules/menu-sidebar/class-astra-menu-sidebar-animation.php
public function add_scripts() {
/*** Start Path Logic */
/* Define Variables */
$uri = ASTRA_EXT_MENU_SIDEBAR_URI . 'assets/js/';
$path = ASTRA_EXT_MENU_SIDEBAR_DIR . 'assets/js/';
/* Directory and Extension */
$file_prefix = '.min';
$dir_name = 'minified';
if ( SCRIPT_DEBUG ) {
$file_prefix = '';
$dir_name = 'unminified';
}
$js_uri = $uri . $dir_name . '/';
$js_dir = $path . $dir_name . '/';
if ( defined( 'ASTRA_THEME_HTTP2' ) && ASTRA_THEME_HTTP2 ) {
$gen_path = $js_uri;
} else {
$gen_path = $js_dir;
}
/*** End Path Logic */
$canvas_trigger_type = astra_get_option( 'shop-off-canvas-trigger-type' );
$mobile_menu_style = astra_get_option( 'mobile-menu-style' );
$mobile_above_menu_style = astra_get_option( 'mobile-above-header-menu-style' );
$mobile_below_menu_style = astra_get_option( 'mobile-below-header-menu-style' );
if ( ( '' != $canvas_trigger_type && 'disable' != $canvas_trigger_type ) ||
'flyout' == $mobile_menu_style || 'fullscreen' == $mobile_menu_style ||
'flyout' == $mobile_above_menu_style ||
'fullscreen' == $mobile_above_menu_style ||
'flyout' == $mobile_below_menu_style ||
'fullscreen' == $mobile_below_menu_style
) {
Astra_Minify::add_dependent_js( 'jquery' );
Astra_Minify::add_js( $gen_path . 'common-sidebar-and-menu' . $file_prefix . '.js' );
}
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 1.4.0 | Introduced. |