summaryrefslogtreecommitdiff
path: root/assets/js/unminified
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/unminified')
-rw-r--r--assets/js/unminified/customizer-controls-toggle.js134
-rw-r--r--assets/js/unminified/customizer-controls.js96
-rw-r--r--assets/js/unminified/customizer-preview.js1587
-rw-r--r--assets/js/unminified/extend-customizer.js349
-rw-r--r--assets/js/unminified/flexibility.js466
-rw-r--r--assets/js/unminified/frontend.js976
-rw-r--r--assets/js/unminified/mobile-cart.js152
-rw-r--r--assets/js/unminified/navigation.js595
-rw-r--r--assets/js/unminified/skip-link-focus-fix.js37
-rw-r--r--assets/js/unminified/style.js595
10 files changed, 4987 insertions, 0 deletions
diff --git a/assets/js/unminified/customizer-controls-toggle.js b/assets/js/unminified/customizer-controls-toggle.js
new file mode 100644
index 0000000..0cdfa01
--- /dev/null
+++ b/assets/js/unminified/customizer-controls-toggle.js
@@ -0,0 +1,134 @@
+/**
+ * Customizer controls toggles
+ *
+ * @package Astra
+ */
+
+( function( $ ) {
+
+
+ /**
+ * Trigger hooks
+ */
+ ASTControlTrigger = {
+
+ /**
+ * Trigger a hook.
+ *
+ * @since 1.0.0
+ * @method triggerHook
+ * @param {String} hook The hook to trigger.
+ * @param {Array} args An array of args to pass to the hook.
+ */
+ triggerHook: function( hook, args )
+ {
+ $( 'body' ).trigger( 'astra-control-trigger.' + hook, args );
+ },
+
+ /**
+ * Add a hook.
+ *
+ * @since 1.0.0
+ * @method addHook
+ * @param {String} hook The hook to add.
+ * @param {Function} callback A function to call when the hook is triggered.
+ */
+ addHook: function( hook, callback )
+ {
+ $( 'body' ).on( 'astra-control-trigger.' + hook, callback );
+ },
+
+ /**
+ * Remove a hook.
+ *
+ * @since 1.0.0
+ * @method removeHook
+ * @param {String} hook The hook to remove.
+ * @param {Function} callback The callback function to remove.
+ */
+ removeHook: function( hook, callback )
+ {
+ $( 'body' ).off( 'astra-control-trigger.' + hook, callback );
+ },
+ };
+
+ /**
+ * Helper class that contains data for showing and hiding controls.
+ *
+ * @since 1.0.0
+ * @class ASTCustomizerToggles
+ */
+ ASTCustomizerToggles = {
+
+ 'astra-settings[display-site-title-responsive]' : [],
+
+ 'astra-settings[display-site-tagline-responsive]' : [],
+
+ 'astra-settings[ast-header-retina-logo]' :[],
+
+ 'custom_logo' : [],
+
+ /**
+ * Section - Header
+ *
+ * @link ?autofocus[section]=section-header
+ */
+
+ /**
+ * Layout 2
+ */
+ // Layout 2 > Right Section > Text / HTML
+ // Layout 2 > Right Section > Search Type
+ // Layout 2 > Right Section > Search Type > Search Box Type.
+ 'astra-settings[header-main-rt-section]' : [],
+
+
+ 'astra-settings[hide-custom-menu-mobile]' :[],
+
+
+ /**
+ * Blog
+ */
+ 'astra-settings[blog-width]' :[],
+
+ 'astra-settings[blog-post-structure]' :[],
+
+ /**
+ * Blog Single
+ */
+ 'astra-settings[blog-single-post-structure]' : [],
+
+ 'astra-settings[blog-single-width]' : [],
+
+ 'astra-settings[blog-single-meta]' :[],
+
+
+ /**
+ * Small Footer
+ */
+ 'astra-settings[footer-sml-layout]' : [],
+
+ 'astra-settings[footer-sml-section-1]' :[],
+
+ 'astra-settings[footer-sml-section-2]' :[],
+
+ 'astra-settings[footer-sml-divider]' :[],
+
+ 'astra-settings[header-main-sep]' :[],
+
+ 'astra-settings[disable-primary-nav]' :[],
+
+ /**
+ * Footer Widgets
+ */
+ 'astra-settings[footer-adv]' :[],
+
+ 'astra-settings[shop-archive-width]' :[],
+
+ 'astra-settings[mobile-header-logo]' :[],
+
+ 'astra-settings[different-mobile-logo]' :[],
+
+ };
+
+} )( jQuery ); \ No newline at end of file
diff --git a/assets/js/unminified/customizer-controls.js b/assets/js/unminified/customizer-controls.js
new file mode 100644
index 0000000..f074bb5
--- /dev/null
+++ b/assets/js/unminified/customizer-controls.js
@@ -0,0 +1,96 @@
+/**
+ * Customizer controls
+ *
+ * @package Astra
+ */
+
+( function( $ ) {
+
+ /* Internal shorthand */
+ var api = wp.customize;
+
+ /**
+ * Helper class for the main Customizer interface.
+ *
+ * @since 1.0.0
+ * @class ASTCustomizer
+ */
+ ASTCustomizer = {
+
+ controls : {},
+
+ /**
+ * Initializes our custom logic for the Customizer.
+ *
+ * @since 1.0.0
+ * @method init
+ */
+ init: function()
+ {
+ ASTCustomizer._initToggles();
+ },
+
+ /**
+ * Initializes the logic for showing and hiding controls
+ * when a setting changes.
+ *
+ * @since 1.0.0
+ * @access private
+ * @method _initToggles
+ */
+ _initToggles: function()
+ {
+
+ // Trigger the Adv Tab Click trigger.
+ ASTControlTrigger.triggerHook( 'astra-toggle-control', api );
+
+ // Loop through each setting.
+ $.each( ASTCustomizerToggles, function( settingId, toggles ) {
+
+ // Get the setting object.
+ api( settingId, function( setting ) {
+
+ // Loop though the toggles for the setting.
+ $.each( toggles, function( i, toggle ) {
+
+ // Loop through the controls for the toggle.
+ $.each( toggle.controls, function( k, controlId ) {
+
+ // Get the control object.
+ api.control( controlId, function( control ) {
+
+ // Define the visibility callback.
+ var visibility = function( to ) {
+ control.container.toggle( toggle.callback( to ) );
+ };
+
+ // Init visibility.
+ visibility( setting.get() );
+
+ // Bind the visibility callback to the setting.
+ setting.bind( visibility );
+ });
+ });
+ });
+ });
+
+ });
+ }
+ };
+
+ $( function() { ASTCustomizer.init(); } );
+
+})( jQuery );
+
+
+( function( api ) {
+ // Extends our custom astra-pro section.
+ api.sectionConstructor['astra-pro'] = api.Section.extend( {
+ // No events for this type of section.
+ attachEvents: function () {},
+ // Always make the section active.
+ isContextuallyActive: function () {
+ return true;
+ }
+ } );
+} )( wp.customize ); \ No newline at end of file
diff --git a/assets/js/unminified/customizer-preview.js b/assets/js/unminified/customizer-preview.js
new file mode 100644
index 0000000..34e2d7a
--- /dev/null
+++ b/assets/js/unminified/customizer-preview.js
@@ -0,0 +1,1587 @@
+/**
+ * This file adds some LIVE to the Theme Customizer live preview. To leverage
+ * this, set your custom settings to 'postMessage' and then add your handling
+ * here. Your javascript should grab settings from customizer controls, and
+ * then make any necessary changes to the page using jQuery.
+ *
+ * @package Astra
+ */
+
+/**
+ * Generate font size in PX & REM
+ */
+function astra_font_size_rem( size, with_rem, device ) {
+
+ var css = '';
+
+ if( size != '' ) {
+
+ var device = ( typeof device != undefined ) ? device : 'desktop';
+
+ // font size with 'px'.
+ css = 'font-size: ' + size + 'px;';
+
+ // font size with 'rem'.
+ if ( with_rem ) {
+ var body_font_size = wp.customize( 'astra-settings[font-size-body]' ).get();
+
+ body_font_size['desktop'] = ( body_font_size['desktop'] != '' ) ? body_font_size['desktop'] : 15;
+ body_font_size['tablet'] = ( body_font_size['tablet'] != '' ) ? body_font_size['tablet'] : body_font_size['desktop'];
+ body_font_size['mobile'] = ( body_font_size['mobile'] != '' ) ? body_font_size['mobile'] : body_font_size['tablet'];
+
+ css += 'font-size: ' + ( size / body_font_size[device] ) + 'rem;';
+ }
+ }
+
+ return css;
+}
+
+
+/**
+ * Apply CSS for the element
+ */
+function astra_color_responsive_css( addon, control, css_property, selector ) {
+
+ wp.customize( control, function( value ) {
+ value.bind( function( value ) {
+ if ( value.desktop || value.mobile || value.tablet ) {
+ // Remove <style> first!
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+ jQuery( 'style#' + control + '-' + addon ).remove();
+
+ var DeskVal = '',
+ TabletFontVal = '',
+ MobileVal = '';
+
+ if ( '' != value.desktop ) {
+ DeskVal = css_property + ': ' + value.desktop;
+ }
+ if ( '' != value.tablet ) {
+ TabletFontVal = css_property + ': ' + value.tablet;
+ }
+ if ( '' != value.mobile ) {
+ MobileVal = css_property + ': ' + value.mobile;
+ }
+
+ // Concat and append new <style>.
+ jQuery( 'head' ).append(
+ '<style id="' + control + '-' + addon + '">'
+ + selector + ' { ' + DeskVal + ' }'
+ + '@media (max-width: 768px) {' + selector + ' { ' + TabletFontVal + ' } }'
+ + '@media (max-width: 544px) {' + selector + ' { ' + MobileVal + ' } }'
+ + '</style>'
+ );
+
+ } else {
+ jQuery( 'style#' + control + '-' + addon ).remove();
+ }
+
+ } );
+ } );
+}
+
+
+/**
+ * Responsive Font Size CSS
+ */
+function astra_responsive_font_size( control, selector ) {
+
+ wp.customize( control, function( value ) {
+ value.bind( function( value ) {
+
+ if ( value.desktop || value.mobile || value.tablet ) {
+ // Remove <style> first!
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+
+ var fontSize = '',
+ tabletFontSize = '',
+ mobileFontSize = '',
+ css_property = 'font-size';
+
+ jQuery( 'style#' + control + '-' + css_property ).remove();
+
+ if ( '' != value.desktop ) {
+ fontSize = 'font-size: ' + value.desktop + value['desktop-unit'];
+ }
+ if ( '' != value.tablet ) {
+ tabletFontSize = 'font-size: ' + value.tablet + value['tablet-unit'];
+ }
+ if ( '' != value.mobile ) {
+ mobileFontSize = 'font-size: ' + value.mobile + value['mobile-unit'];
+ }
+
+ if( value['desktop-unit'] == 'px' ) {
+ fontSize = astra_font_size_rem( value.desktop, true, 'desktop' );
+ }
+
+ // Concat and append new <style>.
+ jQuery( 'head' ).append(
+ '<style id="' + control + '-' + css_property + '">'
+ + selector + ' { ' + fontSize + ' }'
+ + '@media (max-width: 768px) {' + selector + ' { ' + tabletFontSize + ' } }'
+ + '@media (max-width: 544px) {' + selector + ' { ' + mobileFontSize + ' } }'
+ + '</style>'
+ );
+
+ } else {
+ jQuery( 'style#' + control + '-font-size' ).remove();
+ }
+
+ } );
+ } );
+}
+
+/**
+ * Responsive Spacing CSS
+ */
+function astra_responsive_spacing( control, selector, type, side ) {
+
+ wp.customize( control, function( value ) {
+ value.bind( function( value ) {
+ var sidesString = "";
+ var spacingType = "padding";
+ if ( value.desktop.top || value.desktop.right || value.desktop.bottom || value.desktop.left || value.tablet.top || value.tablet.right || value.tablet.bottom || value.tablet.left || value.mobile.top || value.mobile.right || value.mobile.bottom || value.mobile.left ) {
+ if ( typeof side != undefined ) {
+ sidesString = side + "";
+ // Replace comma character with dash, necessary to separate out spacing dimensions.
+ sidesString = sidesString.replace(/,/g , "-");
+ }
+ if ( typeof type != undefined ) {
+ spacingType = type + "";
+ }
+ // Remove <style> first!
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+ jQuery( 'style#' + control + '-' + spacingType + '-' + sidesString ).remove();
+
+ var desktopPadding = '',
+ tabletPadding = '',
+ mobilePadding = '';
+
+ var paddingSide = ( typeof side != undefined ) ? side : [ 'top','bottom','right','left' ];
+
+ jQuery.each(paddingSide, function( index, sideValue ){
+ if ( '' != value['desktop'][sideValue] ) {
+ desktopPadding += spacingType + '-' + sideValue +': ' + value['desktop'][sideValue] + value['desktop-unit'] +';';
+ }
+ });
+
+ jQuery.each(paddingSide, function( index, sideValue ){
+ if ( '' != value['tablet'][sideValue] ) {
+ tabletPadding += spacingType + '-' + sideValue +': ' + value['tablet'][sideValue] + value['tablet-unit'] +';';
+ }
+ });
+
+ jQuery.each(paddingSide, function( index, sideValue ){
+ if ( '' != value['mobile'][sideValue] ) {
+ mobilePadding += spacingType + '-' + sideValue +': ' + value['mobile'][sideValue] + value['mobile-unit'] +';';
+ }
+ });
+
+ // Concat and append new <style>.
+ jQuery( 'head' ).append(
+ '<style id="' + control + '-' + spacingType + '-' + sidesString + '">'
+ + selector + ' { ' + desktopPadding +' }'
+ + '@media (max-width: 768px) {' + selector + ' { ' + tabletPadding + ' } }'
+ + '@media (max-width: 544px) {' + selector + ' { ' + mobilePadding + ' } }'
+ + '</style>'
+ );
+
+ } else {
+ wp.customize.preview.send( 'refresh' );
+ jQuery( 'style#' + control + '-' + spacingType + '-' + sidesString ).remove();
+ }
+
+ } );
+ } );
+}
+
+/**
+ * CSS
+ */
+function astra_css_font_size( control, selector ) {
+
+ wp.customize( control, function( value ) {
+ value.bind( function( size ) {
+
+ if ( size ) {
+
+ // Remove <style> first!
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+ jQuery( 'style#' + control ).remove();
+
+ var fontSize = 'font-size: ' + size;
+ if ( ! isNaN( size ) || size.indexOf( 'px' ) >= 0 ) {
+ size = size.replace( 'px', '' );
+ fontSize = astra_font_size_rem( size, true );
+ }
+
+ // Concat and append new <style>.
+ jQuery( 'head' ).append(
+ '<style id="' + control + '">'
+ + selector + ' { ' + fontSize + ' }'
+ + '</style>'
+ );
+
+ } else {
+
+ jQuery( 'style#' + control ).remove();
+ }
+
+ } );
+ } );
+}
+
+/**
+ * Return get_hexdec()
+ */
+function get_hexdec( hex ) {
+ var hexString = hex.toString( 16 );
+ return parseInt( hexString, 16 );
+}
+
+/**
+ * Apply CSS for the element
+ */
+function astra_css( control, css_property, selector, unit ) {
+
+ wp.customize( control, function( value ) {
+ value.bind( function( new_value ) {
+
+ // Remove <style> first!
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+
+ if ( new_value || 0 === new_value ) {
+
+ /**
+ * If ( unit == 'url' ) then = url('{VALUE}')
+ * If ( unit == 'px' ) then = {VALUE}px
+ * If ( unit == 'em' ) then = {VALUE}em
+ * If ( unit == 'rem' ) then = {VALUE}rem.
+ */
+ if ( 'undefined' != typeof unit) {
+
+ if ( 'url' === unit ) {
+ new_value = 'url(' + new_value + ')';
+ } else {
+ new_value = new_value + unit;
+ }
+ }
+
+ // Remove old.
+ jQuery( 'style#' + control + '-' + css_property ).remove();
+
+ // Concat and append new <style>.
+ jQuery( 'head' ).append(
+ '<style id="' + control + '-' + css_property + '">'
+ + selector + ' { ' + css_property + ': ' + new_value + ' }'
+ + '</style>'
+ );
+
+ if( 'unset' === new_value ){
+ jQuery( 'style#' + control + '-' + css_property ).remove();
+ }
+
+ } else {
+ // Remove old.
+ jQuery( 'style#' + control + '-' + css_property ).remove();
+ }
+
+ } );
+ } );
+}
+
+
+/**
+ * Dynamic Internal/Embedded Style for a Control
+ */
+function astra_add_dynamic_css( control, style ) {
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+ jQuery( 'style#' + control ).remove();
+
+ jQuery( 'head' ).append(
+ '<style id="' + control + '">' + style + '</style>'
+ );
+}
+
+/**
+ * Generate background_obj CSS
+ */
+function astra_background_obj_css( wp_customize, bg_obj, ctrl_name, style ) {
+
+ var gen_bg_css = '';
+ var bg_img = bg_obj['background-image'];
+ var bg_color = bg_obj['background-color'];
+
+ if( '' === bg_color && '' === bg_img ) {
+ jQuery( 'style#' + ctrl_name ).remove();
+ }else{
+ if( undefined !== bg_obj['background-type'] && '' !== bg_obj['background-type'] ) {
+
+ if ( ( 'color' === bg_obj['background-type'] ) ) {
+
+ if ( '' !== bg_img && '' !== bg_color && undefined !== bg_color && 'unset' !== bg_color ) {
+
+ gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_img + ');';
+ } else if ( undefined === bg_img || '' === bg_img || 'unset' === bg_img ) {
+
+ gen_bg_css = 'background-color: ' + bg_color + ';';
+
+ }
+ } else if ( 'image' === bg_obj['background-type'] ) {
+
+ if ( '' !== bg_img && '' !== bg_color && undefined !== bg_color && 'unset' !== bg_color && ! bg_color.includes("linear-gradient") && ! bg_color.includes("radial-gradient") ) {
+
+ gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_img + ');';
+ }
+ if ( ( undefined === bg_color || '' === bg_color || 'unset' === bg_color || bg_color.includes("linear-gradient") || bg_color.includes("radial-gradient") ) && '' !== bg_img ) {
+ gen_bg_css = 'background-image: url(' + bg_img + ');';
+ }
+ } else if ( 'gradient' === bg_obj['background-type'] ) {
+ if ( '' !== bg_color && 'unset' !== bg_color ) {
+ gen_bg_css = 'background-image: ' + bg_color + ';';
+ }
+ }
+ }
+
+ if ( '' !== bg_img ) {
+
+ gen_bg_css += 'background-repeat: ' + bg_obj['background-repeat'] + ';';
+ gen_bg_css += 'background-position: ' + bg_obj['background-position'] + ';';
+ gen_bg_css += 'background-size: ' + bg_obj['background-size'] + ';';
+ gen_bg_css += 'background-attachment: ' + bg_obj['background-attachment'] + ';';
+ }
+
+ var dynamicStyle = style.replace( "{{css}}", gen_bg_css );
+
+ astra_add_dynamic_css( ctrl_name, dynamicStyle );
+ }
+}
+
+/*
+* Generate Font Family CSS
+*/
+function astra_generate_outside_font_family_css( control, selector ) {
+ wp.customize( control, function (value) {
+ value.bind( function ( value, oldValue ) {
+
+ var cssProperty = 'font-family';
+ var link = '';
+
+ var fontName = value.split(",")[0];
+ // Replace ' character with space, necessary to separate out font prop value.
+ fontName = fontName.replace(/'/g, '');
+
+ // Remove <style> first!
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+
+ jQuery('style#' + control + '-' + cssProperty ).remove();
+
+ if ( fontName in astraCustomizer.googleFonts ) {
+ // Remove old.
+
+ var fontName = fontName.split(' ').join('+');
+
+ jQuery('link#' + control).remove();
+ link = '<link id="' + control + '" href="https://fonts.googleapis.com/css?family=' + fontName + '" rel="stylesheet">';
+ }
+
+ // Concat and append new <style> and <link>.
+ jQuery('head').append(
+ '<style id="' + control + '-' + cssProperty + '">'
+ + selector + ' { ' + cssProperty + ': ' + value + ' }'
+ + '</style>'
+ + link
+ );
+ });
+ });
+}
+
+/*
+* Generate Font Weight CSS
+*/
+function astra_generate_font_weight_css( font_control, control, css_property, selector ) {
+ wp.customize( control, function( value ) {
+ value.bind( function( new_value ) {
+
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+ var link = '';
+
+ if ( new_value ) {
+
+ /**
+ * If ( unit == 'url' ) then = url('{VALUE}')
+ * If ( unit == 'px' ) then = {VALUE}px
+ * If ( unit == 'em' ) then = {VALUE}em
+ * If ( unit == 'rem' ) then = {VALUE}rem.
+ */
+ if ( 'undefined' != typeof unit) {
+
+ if ( 'url' === unit ) {
+ new_value = 'url(' + new_value + ')';
+ } else {
+ new_value = new_value + unit;
+ }
+ }
+
+ var fontName = wp.customize._value[font_control]._value;
+ fontName = fontName.split(',');
+ fontName = fontName[0].replace( /'/g, '' );
+
+ // Remove old.
+ jQuery( 'style#' + control + '-' + css_property ).remove();
+
+ if ( fontName in astraCustomizer.googleFonts ) {
+ // Remove old.
+
+ jQuery('#' + font_control).remove();
+ if( new_value === "inherit" ) {
+ link = '<link id="' + font_control + '" href="https://fonts.googleapis.com/css?family=' + fontName + '" rel="stylesheet">';
+ } else {
+ link = '<link id="' + font_control + '" href="https://fonts.googleapis.com/css?family=' + fontName + '%3A' + new_value + '" rel="stylesheet">';
+ }
+ }
+
+ // Concat and append new <style>.
+ jQuery( 'head' ).append(
+ '<style id="' + control + '-' + css_property + '">'
+ + selector + ' { ' + css_property + ': ' + new_value + ' }'
+ + '</style>'
+ + link
+ );
+
+ } else {
+ // Remove old.
+ jQuery( 'style#' + control ).remove();
+ }
+
+ } );
+ });
+}
+
+/**
+ * Apply CSS for the element
+ */
+function astra_apply_responsive_background_css( control, selector, device, singleColorSelector, addon ) {
+ wp.customize( control, function( value ) {
+ value.bind( function( bg_obj ) {
+
+ addon = addon || '';
+ singleColorSelector = singleColorSelector || '';
+
+ addon = ( addon ) ? addon : 'header';
+
+ control = control.replace( '[', '-' );
+ control = control.replace( ']', '' );
+
+ if( '' === bg_obj[device] || undefined === bg_obj[device] ){
+ return;
+ }
+
+ var gen_bg_css = '';
+ var bg_img = bg_obj[device]['background-image'];
+ var bg_tab_img = bg_obj['tablet']['background-image'];
+ var bg_desk_img = bg_obj['desktop']['background-image'];
+ var bg_color = bg_obj[device]['background-color'];
+ var tablet_css = ( bg_obj['tablet']['background-image'] ) ? true : false;
+ var desktop_css = ( bg_obj['desktop']['background-image'] ) ? true : false;
+
+ if( undefined !== bg_obj[device]['background-type'] && '' !== bg_obj[device]['background-type'] ) {
+ if ( ( 'color' === bg_obj[device]['background-type'] ) ) {
+ if ( '' !== bg_img && '' !== bg_color && undefined !== bg_color && 'unset' !== bg_color ) {
+ gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_img + ');';
+ } else if ( 'mobile' === device ) {
+ if ( desktop_css ) {
+ gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_desk_img + ');';
+ } else if ( tablet_css ) {
+ gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_tab_img + ');';
+ } else {
+ gen_bg_css = 'background-color: ' + bg_color + ';';
+ gen_bg_css += 'background-image: none;';
+ }
+ } else if ( 'tablet' === device ) {
+ if ( desktop_css ) {
+ gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_desk_img + ');';
+ } else {
+ gen_bg_css = 'background-color: ' + bg_color + ';';
+ gen_bg_css += 'background-image: none;';
+ }
+ } else if ( undefined === bg_img || '' === bg_img ) {
+ gen_bg_css = 'background-color: ' + bg_color + ';';
+ gen_bg_css += 'background-image: none;';
+ }
+ } else if ( 'image' === bg_obj[device]['background-type'] ) {
+ if ( '' !== bg_img && '' !== bg_color && undefined !== bg_color && 'unset' !== bg_color && ! bg_color.includes("linear-gradient") && ! bg_color.includes("radial-gradient") ) {
+ gen_bg_css = 'background-image: linear-gradient(to right, ' + bg_color + ', ' + bg_color + '), url(' + bg_img + ');';
+ }
+ if ( ( undefined === bg_color || '' === bg_color || 'unset' === bg_color || bg_color.includes("linear-gradient") || bg_color.includes("radial-gradient") ) && '' !== bg_img ) {
+ gen_bg_css = 'background-image: url(' + bg_img + ');';
+ }
+ } else if ( 'gradient' === bg_obj[device]['background-type'] ) {
+ if ( '' !== bg_color && 'unset' !== bg_color ) {
+ gen_bg_css = 'background-image: ' + bg_color + ';';
+ }
+ }
+ }
+
+ if ( '' !== bg_img ) {
+
+ gen_bg_css += 'background-repeat: ' + bg_obj[device]['background-repeat'] + ';';
+ gen_bg_css += 'background-position: ' + bg_obj[device]['background-position'] + ';';
+ gen_bg_css += 'background-size: ' + bg_obj[device]['background-size'] + ';';
+ gen_bg_css += 'background-attachment: ' + bg_obj[device]['background-attachment'] + ';';
+ }
+
+ // Remove old.
+ jQuery( 'style#' + control + '-' + device + '-' + addon ).remove();
+
+
+ if ( 'desktop' == device ) {
+ var dynamicStyle = '<style id="' + control + '-' + device + '-' + addon + '">'
+ + selector + ' { ' + gen_bg_css + ' }'
+ + '</style>'
+ }
+ if ( 'tablet' == device ) {
+ var dynamicStyle = '<style id="' + control + '-' + device + '-' + addon + '">'
+ + '@media (max-width: 768px) {' + selector + ' { ' + gen_bg_css + ' } }'
+ + '</style>'
+ }
+ if ( 'mobile' == device ) {
+ var dynamicStyle = '<style id="' + control + '-' + device + '-' + addon + '">'
+ + '@media (max-width: 544px) {' + selector + ' { ' + gen_bg_css + ' } }'
+ + '</style>'
+ }
+
+ // Concat and append new <style>.
+ jQuery( 'head' ).append(
+ dynamicStyle
+ );
+ });
+ });
+}
+
+function getChangedKey( value, other ) {
+
+ value = isJsonString(value) ? JSON.parse(value) : value;
+ other = isJsonString(other) ? JSON.parse(other) : other;
+
+ // Compare two items
+ var compare = function ( item1, item2 ) {
+
+ // Get the object type
+ var itemType = Object.prototype.toString.call(item1);
+
+ // If an object or array, compare recursively
+ if (['[object Array]', '[object Object]'].indexOf(itemType) >= 0) {
+ if ('string' == typeof getChangedKey(item1, item2)) {
+ return false;
+ }
+ }
+
+ // Otherwise, do a simple comparison
+ else {
+
+ // If the two items are not the same type, return false
+ if (itemType !== Object.prototype.toString.call(item2)) return false;
+
+ // Else if it's a function, convert to a string and compare
+ // Otherwise, just compare
+ if (itemType === '[object Function]') {
+ if (item1.toString() !== item2.toString()) return false;
+ } else {
+ if (item1 !== item2) return false;
+ }
+
+ }
+ };
+
+ for ( var key in value ) {
+ if ( other.hasOwnProperty(key) && value.hasOwnProperty(key) ) {
+ if ( compare( value[key], other[key] ) === false ) return key;
+ } else {
+ return key;
+ }
+ }
+
+ // If nothing failed, return true
+ return true;
+
+}
+
+function isJsonString( str ) {
+
+ try {
+ JSON.parse(str);
+ } catch (e) {
+ return false;
+ }
+ return true;
+}
+
+function hasWordPressWidgetBlockEditor() {
+ return astraCustomizer.has_block_editor_support || false;
+}
+
+( function( $ ) {
+
+ /*
+ * Site Identity Logo Width
+ */
+ wp.customize( 'astra-settings[ast-header-responsive-logo-width]', function( setting ) {
+ setting.bind( function( logo_width ) {
+ if ( logo_width['desktop'] != '' || logo_width['tablet'] != '' || logo_width['mobile'] != '' ) {
+ var dynamicStyle = '#masthead .site-logo-img .custom-logo-link img { max-width: ' + logo_width['desktop'] + 'px; } @media( max-width: 768px ) { #masthead .site-logo-img .custom-logo-link img { max-width: ' + logo_width['tablet'] + 'px; } #masthead .site-logo-img img { max-height: ' + logo_width['tablet'] + 'px; } } @media( max-width: 544px ) { .ast-header-break-point .site-branding img, .ast-header-break-point #masthead .site-logo-img .custom-logo-link img { max-width: ' + logo_width['mobile'] + 'px; }' +
+ '#masthead .site-logo-img img { max-height: ' + logo_width['mobile'] + 'px; } .astra-logo-svg{width: ' + logo_width['mobile'] + 'px !important; } }';
+ astra_add_dynamic_css( 'ast-header-responsive-logo-width', dynamicStyle );
+ var mobileLogoStyle = '.ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img { max-width: ' + logo_width['tablet'] + 'px; } @media( max-width: 768px ) { .ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img { max-width: ' + logo_width['tablet'] + 'px; } @media( max-width: 544px ) { .ast-header-break-point #masthead .site-logo-img .custom-mobile-logo-link img { max-width: ' + logo_width['mobile'] + 'px; }';
+ astra_add_dynamic_css( 'mobile-header-logo-width', mobileLogoStyle );
+ }
+ else{
+ wp.customize.preview.send( 'refresh' );
+ }
+ } );
+ } );
+
+ /*
+ * Responsive Logo Visibility
+ */
+ wp.customize( 'astra-settings[display-site-title-responsive]', function( setting ) {
+ setting.bind( function( logo_visibility ) {
+ var desktopTitleVisibility = ( logo_visibility['desktop'] ) ? 'block' : 'none';
+ var tabletTitleVisibility = ( logo_visibility['tablet'] ) ? 'block' : 'none';
+ var mobileTitleVisibility = ( logo_visibility['mobile'] ) ? 'block' : 'none';
+ var tabletBreakPoint = astraBuilderPreview.tablet_break_point || 768,
+ mobileBreakPoint = astraBuilderPreview.mobile_break_point || 544;
+ var dynamicStyle = '.ast-site-title-wrap .site-title { display: ' + desktopTitleVisibility + ';} @media( max-width: ' + tabletBreakPoint + 'px) { .ast-site-title-wrap .site-title { display: ' + tabletTitleVisibility + ';} } @media( max-width: ' + mobileBreakPoint + 'px) { .ast-site-title-wrap .site-title { display: ' + mobileTitleVisibility + ';} }';
+ astra_add_dynamic_css( 'display-site-title-responsive', dynamicStyle );
+ } );
+ } );
+
+ /*
+ * Responsive Tagline Visibility
+ */
+ wp.customize( 'astra-settings[display-site-tagline-responsive]', function( setting ) {
+ setting.bind( function( tagline_visibility ) {
+ var desktopTaglineVisibility = ( tagline_visibility['desktop'] ) ? 'block' : 'none';
+ var tabletTaglineVisibility = ( tagline_visibility['tablet'] ) ? 'block' : 'none';
+ var mobileTaglineVisibility = ( tagline_visibility['mobile'] ) ? 'block' : 'none';
+ var tabletBreakPoint = astraBuilderPreview.tablet_break_point || 768,
+ mobileBreakPoint = astraBuilderPreview.mobile_break_point || 544;
+ var dynamicStyle = '.ast-site-title-wrap .site-description { display: ' + desktopTaglineVisibility + ';} @media( max-width: ' + tabletBreakPoint + 'px) { .ast-site-title-wrap .site-description { display: ' + tabletTaglineVisibility + ';} } @media( max-width: ' + mobileBreakPoint + 'px) { .ast-site-title-wrap .site-description { display: ' + mobileTaglineVisibility + ';} }';
+ astra_add_dynamic_css( 'display-site-tagline-responsive', dynamicStyle );
+ } );
+ } );
+
+ /*
+ * Full width layout
+ */
+ wp.customize( 'astra-settings[site-content-width]', function( setting ) {
+ setting.bind( function( width ) {
+ var dynamicStyle = '@media (min-width: 554px) {';
+ dynamicStyle += '.ast-container, .fl-builder #content .entry-header { max-width: ' + ( 40 + parseInt( width ) ) + 'px } ';
+ dynamicStyle += '}';
+ if ( jQuery( 'body' ).hasClass( 'ast-page-builder-template' ) ) {
+ dynamicStyle += '@media (min-width: 554px) {';
+ dynamicStyle += '.ast-page-builder-template .comments-area { max-width: ' + ( 40 + parseInt( width ) ) + 'px } ';
+ dynamicStyle += '}';
+ }
+
+ astra_add_dynamic_css( 'site-content-width', dynamicStyle );
+
+ } );
+ } );
+
+ /*
+ * Full width layout
+ */
+ wp.customize( 'astra-settings[header-main-menu-label]', function( setting ) {
+ setting.bind( function( label ) {
+ if( $('button.main-header-menu-toggle .mobile-menu-wrap .mobile-menu').length > 0 ) {
+ if ( label != '' ) {
+ $('button.main-header-menu-toggle .mobile-menu-wrap .mobile-menu').text(label);
+ } else {
+ $('button.main-header-menu-toggle .mobile-menu-wrap').remove();
+ }
+ } else {
+ var html = $('button.main-header-menu-toggle').html();
+ if( '' != label ) {
+ html += '<div class="mobile-menu-wrap"><span class="mobile-menu">'+ label +'</span> </div>';
+ }
+ $('button.main-header-menu-toggle').html( html )
+ }
+ } );
+ } );
+
+ /*
+ * Layout Body Background
+ */
+ astra_apply_responsive_background_css( 'astra-settings[site-layout-outside-bg-obj-responsive]', 'body, .ast-separate-container', 'desktop' );
+ astra_apply_responsive_background_css( 'astra-settings[site-layout-outside-bg-obj-responsive]', 'body, .ast-separate-container', 'tablet' );
+ astra_apply_responsive_background_css( 'astra-settings[site-layout-outside-bg-obj-responsive]', 'body, .ast-separate-container', 'mobile' );
+
+ /*
+ * Blog Custom Width
+ */
+ wp.customize( 'astra-settings[blog-max-width]', function( setting ) {
+ setting.bind( function( width ) {
+
+ var dynamicStyle = '@media all and ( min-width: 921px ) {';
+
+ if ( ! jQuery( 'body' ).hasClass( 'ast-woo-shop-archive' ) ) {
+ dynamicStyle += '.blog .site-content > .ast-container,.archive .site-content > .ast-container{ max-width: ' + ( parseInt( width ) ) + 'px } ';
+ }
+
+ if ( jQuery( 'body' ).hasClass( 'ast-fluid-width-layout' ) ) {
+ dynamicStyle += '.blog .site-content > .ast-container,.archive .site-content > .ast-container{ padding-left:20px; padding-right:20px; } ';
+ }
+ dynamicStyle += '}';
+ astra_add_dynamic_css( 'blog-max-width', dynamicStyle );
+
+ } );
+ } );
+
+ /*
+ * Single Blog Custom Width
+ */
+ wp.customize( 'astra-settings[blog-single-max-width]', function( setting ) {
+ setting.bind( function( width ) {
+
+ var dynamicStyle = '@media all and ( min-width: 921px ) {';
+
+ dynamicStyle += '.single-post .site-content > .ast-container{ max-width: ' + ( 40 + parseInt( width ) ) + 'px } ';
+
+ if ( jQuery( 'body' ).hasClass( 'ast-fluid-width-layout' ) ) {
+ dynamicStyle += '.single-post .site-content > .ast-container{ padding-left:20px; padding-right:20px; } ';
+ }
+ dynamicStyle += '}';
+ astra_add_dynamic_css( 'blog-single-max-width', dynamicStyle );
+
+ } );
+ } );
+
+ /*
+ * EDD Archive Custom Width
+ */
+ wp.customize( 'astra-settings[edd-archive-max-width]', function( setting ) {
+ setting.bind( function( width ) {
+
+ var dynamicStyle = '.ast-edd-archive-page .site-content > .ast-container { max-width: ' + parseInt( width ) + 'px } ';
+
+ astra_add_dynamic_css( 'edd-archive-max-width', dynamicStyle );
+
+ } );
+ } );
+
+ /**
+ * Primary Width Option
+ */
+ wp.customize( 'astra-settings[site-sidebar-width]', function( setting ) {
+ setting.bind( function( width ) {
+
+ if ( ! jQuery( 'body' ).hasClass( 'ast-no-sidebar' ) && width >= 15 && width <= 50 ) {
+
+ var dynamicStyle = '@media (min-width: 769px) {';
+
+ dynamicStyle += '#primary { width: ' + ( 100 - parseInt( width ) ) + '% } ';
+ dynamicStyle += '#secondary { width: ' + width + '% } ';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'site-sidebar-width', dynamicStyle );
+ }
+
+ } );
+ } );
+
+ /**
+ * Header Bottom Border
+ */
+ wp.customize( 'astra-settings[header-main-sep]', function( setting ) {
+ setting.bind( function( border ) {
+
+ var dynamicStyle = 'body.ast-header-break-point .main-header-bar { border-bottom-width: ' + border + 'px }';
+
+ dynamicStyle += '.ast-desktop .main-header-bar {';
+ dynamicStyle += 'border-bottom-width: ' + border + 'px';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'header-main-sep', dynamicStyle );
+
+ } );
+ } );
+
+ /**
+ * Small Footer Top Border
+ */
+ wp.customize( 'astra-settings[footer-sml-divider]', function( value ) {
+ value.bind( function( border_width ) {
+ jQuery( '.ast-small-footer' ).css( 'border-top-width', border_width + 'px' );
+ } );
+ } );
+
+ /**
+ * Footer Widget Top Border
+ */
+ wp.customize( 'astra-settings[footer-adv-border-width]', function( value ) {
+ value.bind( function( border_width ) {
+ jQuery( '.footer-adv .footer-adv-overlay' ).css( 'border-top-width', border_width + 'px' );
+ } );
+ } );
+
+
+ wp.customize( 'astra-settings[footer-adv-border-color]', function( value ) {
+ value.bind( function( border_color ) {
+ jQuery( '.footer-adv .footer-adv-overlay' ).css( 'border-top-color', border_color );
+ } );
+ } );
+
+
+ /**
+ * Small Footer Top Border Color
+ */
+ wp.customize( 'astra-settings[footer-sml-divider-color]', function( value ) {
+ value.bind( function( border_color ) {
+ jQuery( '.ast-small-footer' ).css( 'border-top-color', border_color );
+ } );
+ } );
+
+ /**
+ * Button Border Radius
+ */
+ wp.customize( 'astra-settings[button-radius]', function( setting ) {
+ setting.bind( function( border ) {
+
+ var search_button_selector = hasWordPressWidgetBlockEditor() ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : '' ;
+
+ var dynamicStyle = '.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + search_button_selector + '{ border-radius: ' + ( parseInt( border ) ) + 'px } ';
+ if ( jQuery( 'body' ).hasClass( 'woocommerce' ) ) {
+ dynamicStyle += '.woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled] { border-radius: ' + ( parseInt( border ) ) + 'px } ';
+ }
+
+ astra_add_dynamic_css( 'button-radius', dynamicStyle );
+
+ } );
+ } );
+
+ /**
+ * Header Bottom Border width
+ */
+ wp.customize( 'astra-settings[header-main-sep]', function( value ) {
+ value.bind( function( border ) {
+
+ var dynamicStyle = ' body.ast-header-break-point .main-header-bar { border-bottom-width: ' + border + 'px } ';
+
+ dynamicStyle += '.ast-desktop .main-header-bar {';
+ dynamicStyle += 'border-bottom-width: ' + border + 'px';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'header-main-sep', dynamicStyle );
+
+ } );
+ } );
+
+ /**
+ * Header Bottom Border color
+ */
+ wp.customize( 'astra-settings[header-main-sep-color]', function( value ) {
+ value.bind( function( color ) {
+ if (color == '') {
+ wp.customize.preview.send( 'refresh' );
+ }
+
+ if ( color ) {
+
+ var dynamicStyle = ' .ast-desktop .main-header-bar { border-bottom-color: ' + color + '; } ';
+ dynamicStyle += ' body.ast-header-break-point .main-header-bar { border-bottom-color: ' + color + '; } ';
+
+ astra_add_dynamic_css( 'header-main-sep-color', dynamicStyle );
+ }
+
+ } );
+ } );
+
+ /**
+ * Primary Toggle Button Color
+ */
+ wp.customize( 'astra-settings[mobile-header-toggle-btn-style-color]', function( setting ) {
+ setting.bind( function( toggle_button_color ) {
+ if ( toggle_button_color != '' ) {
+ if( jQuery( '.menu-toggle' ).hasClass( 'ast-mobile-menu-buttons-fill' ) ) {
+ var dynamicStyle = '.ast-header-break-point .ast-mobile-menu-buttons-fill.menu-toggle { background: ' + toggle_button_color + '}';
+ }
+ else if( jQuery( '.menu-toggle' ).hasClass( 'ast-mobile-menu-buttons-outline' ) ) {
+ var dynamicStyle = '.ast-header-break-point .ast-mobile-menu-buttons-outline.menu-toggle { border: 1px solid ' + toggle_button_color + '; color: ' + toggle_button_color + '}';
+ }
+ else {
+ var dynamicStyle = '.ast-header-break-point .ast-mobile-menu-buttons-minimal.menu-toggle { color: ' + toggle_button_color + '}';
+ }
+ astra_add_dynamic_css( 'primary-toggle-button-color', dynamicStyle );
+ }
+ else{
+ wp.customize.preview.send( 'refresh' );
+ }
+ });
+ });
+
+
+ astra_responsive_font_size( 'astra-settings[font-size-site-tagline]', '.site-header .site-description' );
+ astra_responsive_font_size( 'astra-settings[font-size-site-title]', '.site-title' );
+
+ astra_responsive_font_size( 'astra-settings[font-size-entry-title]', '.ast-single-post .entry-title, .page-title' );
+ astra_responsive_font_size( 'astra-settings[font-size-archive-summary-title]', '.ast-archive-description .ast-archive-title' );
+ astra_responsive_font_size( 'astra-settings[font-size-page-title]', 'body:not(.ast-single-post) .entry-title' );
+
+ // Check if anchors should be loaded in the CSS for headings.
+ if (true == astraCustomizer.includeAnchorsInHeadindsCss) {
+ astra_responsive_font_size('astra-settings[font-size-h1]', 'h1, .entry-content h1, .entry-content h1 a');
+ astra_responsive_font_size('astra-settings[font-size-h2]', 'h2, .entry-content h2, .entry-content h2 a');
+ astra_responsive_font_size('astra-settings[font-size-h3]', 'h3, .entry-content h3, .entry-content h3 a');
+ astra_responsive_font_size('astra-settings[font-size-h4]', 'h4, .entry-content h4, .entry-content h4 a');
+ astra_responsive_font_size('astra-settings[font-size-h5]', 'h5, .entry-content h5, .entry-content h5 a');
+ astra_responsive_font_size('astra-settings[font-size-h6]', 'h6, .entry-content h6, .entry-content h6 a');
+ } else {
+ astra_responsive_font_size('astra-settings[font-size-h1]', 'h1, .entry-content h1');
+ astra_responsive_font_size('astra-settings[font-size-h2]', 'h2, .entry-content h2');
+ astra_responsive_font_size('astra-settings[font-size-h3]', 'h3, .entry-content h3');
+ astra_responsive_font_size('astra-settings[font-size-h4]', 'h4, .entry-content h4');
+ astra_responsive_font_size('astra-settings[font-size-h5]', 'h5, .entry-content h5');
+ astra_responsive_font_size('astra-settings[font-size-h6]', 'h6, .entry-content h6');
+ }
+
+ // paragraph margin bottom.
+ wp.customize( 'astra-settings[para-margin-bottom]', function( value ) {
+ value.bind( function( marginBottom ) {
+ if ( marginBottom == '' ) {
+ wp.customize.preview.send( 'refresh' );
+ }
+
+ if ( marginBottom ) {
+ var dynamicStyle = ' p, .entry-content p { margin-bottom: ' + marginBottom + 'em; } ';
+ astra_add_dynamic_css( 'para-margin-bottom', dynamicStyle );
+ }
+
+ } );
+ } );
+
+ // Add preview underline in customizer for content links.
+ wp.customize( 'astra-settings[underline-content-links]', function( setting ) {
+ setting.bind( function( value ) {
+ var dynamicStyle = '';
+ if ( value ) {
+ dynamicStyle = '.ast-single-post .entry-content a, .ast-comment-content a:not(.ast-comment-edit-reply-wrap a) { text-decoration: underline; } ';
+ astra_add_dynamic_css( 'underline-content-links', dynamicStyle );
+ } else {
+ dynamicStyle = '.ast-single-post .entry-content a, .ast-comment-content a:not(.ast-comment-edit-reply-wrap a) { text-decoration: unset; } ';
+ astra_add_dynamic_css( 'underline-content-links', dynamicStyle );
+ }
+ } );
+ } );
+
+ if ( astraCustomizer.page_builder_button_style_css ) {
+ if (true == astraCustomizer.includeAnchorsInHeadindsCss) {
+ if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'typo' == astraCustomizer.elementor_default_color_font_setting ) {
+ astra_css('astra-settings[headings-line-height]', 'line-height', '.elementor-widget-heading h1.elementor-heading-title, .elementor-widget-heading h2.elementor-heading-title, .elementor-widget-heading h3.elementor-heading-title, .elementor-widget-heading h4.elementor-heading-title, .elementor-widget-heading h5.elementor-heading-title, .elementor-widget-heading h6.elementor-heading-title');
+ }
+ astra_css('astra-settings[headings-line-height]', 'line-height', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a');
+ } else {
+ if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'typo' == astraCustomizer.elementor_default_color_font_setting ) {
+ astra_css('astra-settings[headings-line-height]', 'line-height', '.elementor-widget-heading h1.elementor-heading-title, .elementor-widget-heading h2.elementor-heading-title, .elementor-widget-heading h3.elementor-heading-title, .elementor-widget-heading h4.elementor-heading-title, .elementor-widget-heading h5.elementor-heading-title, .elementor-widget-heading h6.elementor-heading-title');
+ }
+ astra_css('astra-settings[headings-line-height]', 'line-height', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a');
+ }
+ } else {
+ if (true == astraCustomizer.includeAnchorsInHeadindsCss) {
+ astra_css('astra-settings[headings-line-height]', 'line-height', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a');
+ } else {
+ astra_css('astra-settings[headings-line-height]', 'line-height', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a');
+ }
+ }
+
+ // Check if anchors should be loaded in the CSS for headings.
+ if (true == astraCustomizer.includeAnchorsInHeadindsCss) {
+ astra_generate_outside_font_family_css('astra-settings[headings-font-family]', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a');
+ astra_generate_font_weight_css( 'astra-settings[headings-font-family]', 'astra-settings[headings-font-weight]', 'font-weight', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a' );
+ astra_css('astra-settings[headings-text-transform]', 'text-transform', 'h1, .entry-content h1, .entry-content h1 a, h2, .entry-content h2, .entry-content h2 a, h3, .entry-content h3, .entry-content h3 a, h4, .entry-content h4, .entry-content h4 a, h5, .entry-content h5, .entry-content h5 a, h6, .entry-content h6, .entry-content h6 a, .site-title, .site-title a');
+ } else {
+ astra_generate_outside_font_family_css('astra-settings[headings-font-family]', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a');
+ astra_generate_font_weight_css( 'astra-settings[headings-font-family]', 'astra-settings[headings-font-weight]', 'font-weight', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a' );
+ astra_css('astra-settings[headings-text-transform]', 'text-transform', 'h1, .entry-content h1, h2, .entry-content h2, h3, .entry-content h3, h4, .entry-content h4, h5, .entry-content h5, h6, .entry-content h6, .site-title, .site-title a');
+ }
+
+
+ // Footer Bar.
+ astra_css( 'astra-settings[footer-color]', 'color', '.ast-small-footer' );
+ astra_css( 'astra-settings[footer-link-color]', 'color', '.ast-small-footer a' );
+ astra_css( 'astra-settings[footer-link-h-color]', 'color', '.ast-small-footer a:hover' );
+
+ // Footer Bar background.
+ wp.customize( 'astra-settings[footer-bg-obj]', function( value ) {
+ value.bind( function( bg_obj ) {
+ var dynamicStyle = ' .ast-small-footer > .ast-footer-overlay { {{css}} }';
+ astra_background_obj_css( wp.customize, bg_obj, 'footer-bg-obj', dynamicStyle );
+ } );
+ } );
+
+ // Footer Widgets.
+ astra_css( 'astra-settings[footer-adv-wgt-title-color]', 'color', '.footer-adv .widget-title, .footer-adv .widget-title a' );
+ astra_css( 'astra-settings[footer-adv-text-color]', 'color', '.footer-adv' );
+ astra_css( 'astra-settings[footer-adv-link-color]', 'color', '.footer-adv a' );
+ astra_css( 'astra-settings[footer-adv-link-h-color]', 'color', '.footer-adv a:hover, .footer-adv .no-widget-text a:hover, .footer-adv a:focus, .footer-adv .no-widget-text a:focus' );
+
+ // Footer Widget background.
+ wp.customize( 'astra-settings[footer-adv-bg-obj]', function( value ) {
+ value.bind( function( bg_obj ) {
+ var dynamicStyle = ' .footer-adv-overlay { {{css}} }';
+ astra_background_obj_css( wp.customize, bg_obj, 'footer-adv-bg-obj', dynamicStyle );
+ } );
+ } );
+
+ /*
+ * Woocommerce Shop Archive Custom Width
+ */
+ wp.customize( 'astra-settings[shop-archive-max-width]', function( setting ) {
+ setting.bind( function( width ) {
+
+ var dynamicStyle = '@media all and ( min-width: 921px ) {';
+
+ dynamicStyle += '.ast-woo-shop-archive .site-content > .ast-container{ max-width: ' + ( parseInt( width ) ) + 'px } ';
+
+ if ( jQuery( 'body' ).hasClass( 'ast-fluid-width-layout' ) ) {
+ dynamicStyle += '.ast-woo-shop-archive .site-content > .ast-container{ padding-left:20px; padding-right:20px; } ';
+ }
+ dynamicStyle += '}';
+ astra_add_dynamic_css( 'shop-archive-max-width', dynamicStyle );
+
+ } );
+ } );
+
+ //[1] Primary Menu Toggle Button Style.
+ wp.customize( 'astra-settings[mobile-header-toggle-btn-style]', function( setting ) {
+ setting.bind( function( icon_style ) {
+ var icon_color = wp.customize('astra-settings[mobile-header-toggle-btn-color]').get();
+
+ if ( '' === icon_color && 'fill' === icon_style ) {
+ var dynamicStyle = ' [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg { fill: #ffffff; } ';
+ astra_add_dynamic_css( 'mobile-header-toggle-btn-style', dynamicStyle );
+ } else {
+ astra_add_dynamic_css( 'mobile-header-toggle-btn-style', '' );
+ }
+
+ var buttons = $(document).find('.ast-mobile-menu-buttons .menu-toggle');
+ buttons.removeClass('ast-mobile-menu-buttons-default ast-mobile-menu-buttons-fill ast-mobile-menu-buttons-outline');
+ buttons.removeClass('ast-mobile-menu-buttons-default ast-mobile-menu-buttons-fill ast-mobile-menu-buttons-minimal');
+ buttons.addClass( 'ast-mobile-menu-buttons-' + icon_style );
+
+ var themeColor = wp.customize( 'astra-settings[theme-color]' ).get();
+ var defaultColor = '#ffffff';
+ var toggleButtonColor = wp.customize( 'astra-settings[mobile-header-toggle-btn-color]' ).get();
+
+ if ( 'fill' !== icon_style ) {
+ defaultColor = themeColor
+ }
+
+ var iconColor = defaultColor;
+
+ if ( '' !== toggleButtonColor && undefined !== toggleButtonColor && null !== toggleButtonColor ) {
+ iconColor = toggleButtonColor
+ }
+
+ var dynamicStyle = '[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg {';
+ dynamicStyle += 'fill: ' + iconColor + ';';
+ dynamicStyle +='}';
+
+ dynamicStyle += '[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-wrap .mobile-menu {';
+ dynamicStyle += 'color: ' + iconColor + ';';
+ dynamicStyle +='}';
+
+ dynamicStyle += '[data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-trigger-fill, [data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-trigger-minimal {';
+ dynamicStyle += 'color: ' + iconColor + ';';
+ dynamicStyle += 'border: none;';
+ dynamicStyle +='}';
+
+ dynamicStyle += '[data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-trigger-outline {';
+ dynamicStyle += 'color: ' + iconColor + ';';
+ dynamicStyle +='}';
+ ;
+ astra_add_dynamic_css( 'mobile-header-toggle-btn-style', dynamicStyle );
+
+ } );
+ } );
+
+ //[1] Toggle Button Border Radius.
+ wp.customize( 'astra-settings[mobile-header-toggle-btn-border-radius]', function( setting ) {
+ setting.bind( function( border ) {
+
+ var dynamicStyle = '.ast-header-break-point .main-header-bar .ast-button-wrap .menu-toggle { border-radius: ' + ( parseInt( border ) ) + 'px } ';
+ astra_add_dynamic_css( 'mobile-header-toggle-btn-border-radius', dynamicStyle );
+
+ } );
+ } );
+
+ /**
+ * Primary Submenu border
+ */
+ wp.customize( 'astra-settings[primary-submenu-border]', function( value ) {
+ value.bind( function( border ) {
+ var color = wp.customize( 'astra-settings[primary-submenu-b-color]' ).get();
+
+ if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) {
+
+ var dynamicStyle = '.ast-desktop .main-header-menu.submenu-with-border .sub-menu';
+ dynamicStyle += '{';
+ dynamicStyle += 'border-top-width:' + border.top + 'px;';
+ dynamicStyle += 'border-right-width:' + border.right + 'px;';
+ dynamicStyle += 'border-left-width:' + border.left + 'px;';
+ dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;';
+ dynamicStyle += 'border-color:' + color + ';';
+ dynamicStyle += 'border-style: solid;';
+ dynamicStyle += '}';
+
+ dynamicStyle += '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .sub-menu';
+ dynamicStyle += '{';
+ dynamicStyle += 'top:-' + border.top + 'px;';
+ dynamicStyle += '}';
+
+ // Submenu items goes outside?
+ dynamicStyle += '@media (min-width: 769px){';
+ dynamicStyle += '.main-header-menu .sub-menu .menu-item.ast-left-align-sub-menu:hover > .sub-menu, .main-header-menu .sub-menu .menu-item.ast-left-align-sub-menu.focus > .sub-menu';
+ dynamicStyle += '{';
+ dynamicStyle += 'margin-left:-' + ( +border.left + +border.right ) + 'px;';
+ dynamicStyle += '}';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'primary-submenu-border', dynamicStyle );
+ } else {
+ wp.customize.preview.send( 'refresh' );
+ }
+ } );
+ } );
+ /**
+ * Primary Submenu border COlor
+ */
+ wp.customize( 'astra-settings[primary-submenu-b-color]', function( value ) {
+ value.bind( function( color ) {
+ var border = wp.customize( 'astra-settings[primary-submenu-border]' ).get();
+ if ( '' != color ) {
+ if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) {
+
+ var dynamicStyle = '.ast-desktop .main-header-menu.submenu-with-border .sub-menu';
+ dynamicStyle += '{';
+ dynamicStyle += 'border-top-width:' + border.top + 'px;';
+ dynamicStyle += 'border-right-width:' + border.right + 'px;';
+ dynamicStyle += 'border-left-width:' + border.left + 'px;';
+ dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;';
+ dynamicStyle += 'border-color:' + color + ';';
+ dynamicStyle += 'border-style: solid;';
+ dynamicStyle += '}';
+
+ dynamicStyle += '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .sub-menu';
+ dynamicStyle += '{';
+ dynamicStyle += 'top:-' + border.top + 'px;';
+ dynamicStyle += '}';
+
+ // Submenu items goes outside?
+ dynamicStyle += '@media (min-width: 769px){';
+ dynamicStyle += '.main-header-menu .sub-menu .menu-item.ast-left-align-sub-menu:hover > .sub-menu, .main-header-menu .sub-menu .menu-item.ast-left-align-sub-menu.focus > .sub-menu';
+ dynamicStyle += '{';
+ dynamicStyle += 'margin-left:-' + ( +border.left + +border.right ) + 'px;';
+ dynamicStyle += '}';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'primary-submenu-border-color', dynamicStyle );
+ }
+ } else {
+ wp.customize.preview.send( 'refresh' );
+ }
+ } );
+ } );
+
+
+ /**
+ * Primary Submenu border COlor
+ */
+ wp.customize('astra-settings[primary-submenu-item-b-color]', function (value) {
+ value.bind(function (color) {
+ var insideBorder = wp.customize('astra-settings[primary-submenu-item-border]').get();
+ if ('' != color) {
+ if ( true == insideBorder ) {
+
+ var dynamicStyle = '';
+
+ dynamicStyle += '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .menu-link';
+ dynamicStyle += '{';
+ dynamicStyle += 'border-bottom-width:' + ( ( true === insideBorder ) ? '1px;' : '0px;' );
+ dynamicStyle += 'border-color:' + color + ';';
+ dynamicStyle += 'border-style: solid;';
+ dynamicStyle += '}';
+
+
+ astra_add_dynamic_css('primary-submenu-item-b-color', dynamicStyle);
+ }
+ } else {
+ wp.customize.preview.send('refresh');
+ }
+ });
+ });
+
+ /**
+ * Primary Submenu border COlor
+ */
+ wp.customize( 'astra-settings[primary-submenu-item-border]', function( value ) {
+ value.bind( function( border ) {
+ var color = wp.customize( 'astra-settings[primary-submenu-item-b-color]' ).get();
+
+ if( true === border ) {
+ var dynamicStyle = '.ast-desktop .main-header-menu.submenu-with-border .sub-menu .menu-link';
+ dynamicStyle += '{';
+ dynamicStyle += 'border-bottom-width:' + ( ( true === border ) ? '1px;' : '0px;' );
+ dynamicStyle += 'border-color:' + color + ';';
+ dynamicStyle += 'border-style: solid;';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'primary-submenu-item-border', dynamicStyle );
+ } else {
+ wp.customize.preview.send( 'refresh' );
+ }
+
+ } );
+ } );
+
+ astra_css( 'astra-settings[header-main-rt-section-button-text-color]', 'color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
+ astra_css( 'astra-settings[header-main-rt-section-button-back-color]', 'background-color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
+ astra_css( 'astra-settings[header-main-rt-section-button-text-h-color]', 'color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
+ astra_css( 'astra-settings[header-main-rt-section-button-back-h-color]', 'background-color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
+ astra_css( 'astra-settings[header-main-rt-section-button-border-radius]', 'border-radius', '.main-header-bar .ast-container .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'px' );
+ astra_css( 'astra-settings[header-main-rt-section-button-border-color]', 'border-color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
+ astra_css( 'astra-settings[header-main-rt-section-button-border-h-color]', 'border-color', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button:hover' );
+ astra_responsive_spacing( 'astra-settings[header-main-rt-section-button-padding]','.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'padding', ['top', 'right', 'bottom', 'left' ] );
+
+ // Header custom button - Typography preview stylings.
+ astra_generate_outside_font_family_css( 'astra-settings[primary-header-button-font-family]', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button, .ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
+
+ astra_responsive_font_size( 'astra-settings[primary-header-button-font-size]', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button, .ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
+
+ astra_css( 'astra-settings[primary-header-button-font-weight]', 'font-weight', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button, .ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
+
+ astra_css( 'astra-settings[primary-header-button-line-height]', 'line-height', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button, .ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
+
+ astra_css( 'astra-settings[primary-header-button-text-transform]', 'text-transform', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button, .ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button' );
+
+ astra_css( 'astra-settings[primary-header-button-letter-spacing]', 'letter-spacing', '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button, .ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button', 'px' );
+
+ /**
+ * Custom Button border
+ */
+ wp.customize( 'astra-settings[header-main-rt-section-button-border-size]', function( value ) {
+ value.bind( function( border ) {
+ if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) {
+ var dynamicStyle = '.main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button';
+ dynamicStyle += '{';
+ dynamicStyle += 'border-top-width:' + border.top + 'px;';
+ dynamicStyle += 'border-right-width:' + border.right + 'px;';
+ dynamicStyle += 'border-left-width:' + border.left + 'px;';
+ dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;';
+ dynamicStyle += 'border-style: solid;';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'header-main-rt-section-button-border-size', dynamicStyle );
+ }
+ } );
+ } );
+
+ var ele_border_radius_selector = '';
+ var ele_border_width_selector = '';
+ var ele_padding_selector = '';
+
+ if ( astraCustomizer.page_builder_button_style_css ) {
+ if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'color' == astraCustomizer.elementor_default_color_font_setting || 'font' == astraCustomizer.elementor_default_color_font_setting ) {
+ ele_border_radius_selector = ', .elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button';
+ ele_border_width_selector = ', .elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
+ ele_padding_selector = ', .elementor-button-wrapper .elementor-button.elementor-size-sm, .elementor-button-wrapper .elementor-button.elementor-size-xs, .elementor-button-wrapper .elementor-button.elementor-size-md, .elementor-button-wrapper .elementor-button.elementor-size-lg, .elementor-button-wrapper .elementor-button.elementor-size-xl, .elementor-button-wrapper .elementor-button';
+ }
+ }
+
+ astra_css( 'astra-settings[button-radius]', 'border-radius', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"]' + ele_border_radius_selector, 'px' );
+
+ /**
+ * Button border
+ */
+ wp.customize( 'astra-settings[theme-button-border-group-border-size]', function( value ) {
+ value.bind( function( border ) {
+ if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) {
+ if( astraCustomizer.gb_outline_buttons_patterns_support && ! astraCustomizer.updated_gb_outline_button_patterns ) {
+ wp.customize.preview.send( 'refresh' );
+ } else {
+ var search_button_selector = hasWordPressWidgetBlockEditor() ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : '' ;
+ var dynamicStyle = '.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link' + ele_border_width_selector + search_button_selector;
+ dynamicStyle += '{';
+ dynamicStyle += 'border-top-width:' + border.top + 'px;';
+ dynamicStyle += 'border-right-width:' + border.right + 'px;';
+ dynamicStyle += 'border-left-width:' + border.left + 'px;';
+ dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;';
+ dynamicStyle += 'border-style: solid;';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'theme-button-border-group-border-size', dynamicStyle );
+ }
+ }
+ } );
+ } );
+
+ var search_button_selector = hasWordPressWidgetBlockEditor() ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : '' ;
+
+ astra_responsive_spacing( 'astra-settings[theme-button-padding]','.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled], .wp-block-button .wp-block-button__link' + ele_padding_selector + search_button_selector, 'padding', [ 'top', 'bottom' ] );
+
+ astra_responsive_spacing( 'astra-settings[theme-button-padding]','.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled], .wp-block-button .wp-block-button__link' + ele_padding_selector + search_button_selector, 'padding', [ 'left', 'right' ] );
+
+ /**
+ * Button border
+ */
+ wp.customize( 'astra-settings[transparent-header-button-border-group]', function( value ) {
+ value.bind( function( value ) {
+
+ var optionValue = JSON.parse(value);
+ var border = optionValue['header-main-rt-trans-section-button-border-size'];
+
+ if( '' != border.top || '' != border.right || '' != border.bottom || '' != border.left ) {
+ var dynamicStyle = '.ast-theme-transparent-header .main-header-bar .button-custom-menu-item .ast-custom-button-link .ast-custom-button';
+ dynamicStyle += '{';
+ dynamicStyle += 'border-top-width:' + border.top + 'px;';
+ dynamicStyle += 'border-right-width:' + border.right + 'px;';
+ dynamicStyle += 'border-left-width:' + border.left + 'px;';
+ dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;';
+ dynamicStyle += 'border-style: solid;';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'header-main-rt-trans-section-button-border-size', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Site Title - Font family
+ astra_generate_outside_font_family_css( 'astra-settings[font-family-site-title]', '.site-title, .site-title a' );
+
+ // Site Title - Font Weight
+ astra_generate_font_weight_css( 'astra-settings[font-family-site-title]', 'astra-settings[font-weight-site-title]', 'font-weight', '.site-title, .site-title a' );
+
+ // Site Title - Font Size
+ astra_responsive_font_size( 'astra-settings[font-size-site-title]', '.site-title, .site-title a' );
+
+ // Site Title - Line Height
+ astra_css( 'astra-settings[line-height-site-title]', 'line-height', '.site-title, .site-title a' );
+
+ // Site Title - Text Transform
+ astra_css( 'astra-settings[text-transform-site-title]', 'text-transform', '.site-title, .site-title a' );
+
+ // Site tagline - Font family
+ astra_generate_outside_font_family_css( 'astra-settings[font-family-site-tagline]', '.site-header .site-description' );
+
+ // Site Tagline - Font Weight
+ astra_generate_font_weight_css( 'astra-settings[font-family-site-tagline]', 'astra-settings[font-weight-site-tagline]', 'font-weight', '.site-header .site-description' );
+
+ // Site Tagline - Font Size
+ astra_responsive_font_size( 'astra-settings[font-size-site-tagline]', '.site-header .site-description' );
+
+ // Site Tagline - Line Height
+ astra_css( 'astra-settings[line-height-site-tagline]', 'line-height', '.site-header .site-description' );
+
+ // Site Tagline - Text Transform
+ astra_css( 'astra-settings[text-transform-site-tagline]', 'text-transform', '.site-header .site-description' );
+
+ var search_button_selector = hasWordPressWidgetBlockEditor() ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button' : '' ;
+ var search_button_hover_selector = hasWordPressWidgetBlockEditor() ? ', form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover, form[CLASS*="wp-block-search__"].wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus' : '' ;
+
+ if ( astraCustomizer.page_builder_button_style_css ) {
+
+ var btn_color_ele = '';
+ var btn_bg_color_ele = '';
+ var btn_h_color_ele = '';
+ var btn_bg_h_color_ele = '';
+ var btn_border_color_ele = '';
+ var btn_border_h_color_ele = '';
+
+ if ( 'color-typo' == astraCustomizer.elementor_default_color_font_setting || 'color' == astraCustomizer.elementor_default_color_font_setting ) {
+ // Theme Button - Text Color
+ btn_color_ele = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
+
+ // Theme Button - Background Color
+ btn_bg_color_ele = ',.elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
+
+ // Theme Button - Text Hover Color
+ btn_h_color_ele = ',.elementor-button-wrapper .elementor-button:hover, .elementor-button-wrapper .elementor-button:focus';
+
+ // Theme Button - Background Hover Color
+ btn_bg_h_color_ele = ',.elementor-button-wrapper .elementor-button:hover, .elementor-button-wrapper .elementor-button:focus';
+
+ // Theme Button - Border Color
+ btn_border_color_ele = ', .elementor-button-wrapper .elementor-button, .elementor-button-wrapper .elementor-button:visited';
+
+ // Theme Button - Border Hover Color
+ btn_border_h_color_ele = ',.elementor-button-wrapper .elementor-button:hover, .elementor-button-wrapper .elementor-button:focus';
+ }
+
+ // Theme Button - Text Color
+ astra_css( 'astra-settings[button-color]', 'color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, .ast-custom-button' + btn_color_ele + search_button_selector );
+
+ // Theme Button - Background Color
+ astra_css( 'astra-settings[button-bg-color]', 'background-color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link, .ast-custom-button' + btn_bg_color_ele + search_button_selector );
+
+ // Theme Button - Text Hover Color
+ astra_css( 'astra-settings[button-h-color]', 'color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus, .ast-custom-button:hover, .ast-custom-button:focus' + btn_h_color_ele + search_button_hover_selector );
+
+ // Theme Button - Background Hover Color
+ astra_css( 'astra-settings[button-bg-h-color]', 'background-color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus, .ast-custom-button:hover, .ast-custom-button:focus' + btn_bg_h_color_ele + search_button_hover_selector );
+
+ astra_css( 'astra-settings[theme-button-border-group-border-color]', 'border-color', '.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .wp-block-button .wp-block-button__link' + btn_border_color_ele + search_button_selector );
+
+ // Theme Button - Border Hover Color
+ astra_css( 'astra-settings[theme-button-border-group-border-h-color]', 'border-color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .ast-custom-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .wp-block-button .wp-block-button__link:hover, .wp-block-button .wp-block-button__link:focus' + btn_border_h_color_ele + search_button_hover_selector );
+
+ } else {
+ // Theme Button - Text Color
+ astra_css( 'astra-settings[button-color]', 'color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .ast-custom-button' + search_button_selector );
+
+ // Theme Button - Background Color
+ astra_css( 'astra-settings[button-bg-color]', 'background-color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .ast-custom-button' + search_button_selector );
+
+ // Theme Button - Border Color
+ astra_css( 'astra-settings[button-bg-color]', 'border-color', '.menu-toggle, button, .ast-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .ast-custom-button' + search_button_selector );
+
+ // Theme Button - Text Hover Color
+ astra_css( 'astra-settings[button-h-color]', 'color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .ast-custom-button:hover, .ast-custom-button:focus' + search_button_hover_selector );
+
+ // Theme Button - Background Hover Color
+ astra_css( 'astra-settings[button-bg-h-color]', 'background-color', 'button:focus, .menu-toggle:hover, button:hover, .ast-button:hover, .button:hover, input[type=reset]:hover, input[type=reset]:focus, input#submit:hover, input#submit:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .ast-custom-button:hover, .ast-custom-button:focus' + search_button_hover_selector );
+
+ astra_responsive_spacing( 'astra-settings[theme-button-padding]','.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled]' + search_button_selector, 'padding', [ 'top', 'bottom' ] );
+ astra_responsive_spacing( 'astra-settings[theme-button-padding]','.menu-toggle, button, .ast-button, .ast-custom-button, .button, input#submit, input[type="button"], input[type="submit"], input[type="reset"], .woocommerce a.button, .woocommerce button.button, .woocommerce .product a.button, .woocommerce .woocommerce-message a.button, .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce input.button,.woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled]' + search_button_selector, 'padding', [ 'left', 'right' ] );
+ }
+
+ // Global custom event which triggers when partial refresh occurs.
+ wp.customize.bind('preview-ready', function () {
+
+ wp.customize.selectiveRefresh.bind('render-partials-response', function (response) {
+
+ if( response.contents.hasOwnProperty('astra-settings[footer-desktop-items]')
+ || ( ! ( response.contents.hasOwnProperty('astra-settings[header-desktop-items]')
+ || response.contents.hasOwnProperty('astra-settings[header-mobile-items]') ) ) ) {
+ return false;
+ }
+
+ setTimeout( function () {
+ document.dispatchEvent( new CustomEvent( "astLayoutWidthChanged", { "detail": { 'response' : response } }) );
+ }, 10 );
+
+ });
+
+ wp.customize.selectiveRefresh.bind('partial-content-rendered', function (response) {
+
+ if( response.partial.id.includes("footer") ) {
+ return false;
+ }
+
+ sessionStorage.setItem('astPartialContentRendered', true);
+ document.dispatchEvent( new CustomEvent( "astPartialContentRendered", { "detail": { 'response' : response } }) );
+
+ });
+
+ wp.customize.selectiveRefresh.bind('partial-content-rendered', function (response) {
+
+ wp.customize.preview.send( 'AstraBuilderPartialContentRendered', response );
+
+ });
+
+ wp.customize.preview.bind( 'astPreviewDeviceChanged', function( device ) {
+ document.dispatchEvent( new CustomEvent( "astPreviewDeviceChanged", { "detail": device }) );
+
+ } );
+
+ })
+
+ /**
+ * Related Posts Query Arguments - Customizer preview support.
+ */
+ wp.customize( 'astra-settings[related-posts-based-on]', function( setting ) {
+ setting.bind( function() {
+ wp.customize.preview.send( 'refresh' );
+ } );
+ } );
+ wp.customize( 'astra-settings[related-posts-order-by]', function( setting ) {
+ setting.bind( function() {
+ wp.customize.preview.send( 'refresh' );
+ } );
+ } );
+ wp.customize( 'astra-settings[related-posts-order]', function( setting ) {
+ setting.bind( function() {
+ wp.customize.preview.send( 'refresh' );
+ } );
+ } );
+
+ /**
+ * Related Posts color stylings.
+ */
+ astra_css( 'astra-settings[related-posts-text-color]', 'color', '.ast-related-post-content .entry-header .ast-related-post-title a, .ast-related-post-content .ast-related-post-excerpt' );
+ astra_css( 'astra-settings[related-posts-meta-color]', 'color', '.ast-related-post-content .entry-meta, .ast-related-post-content .entry-meta *' );
+ astra_css( 'astra-settings[related-posts-title-color]', 'color', '.ast-single-related-posts-container .ast-related-posts-title-section .ast-related-posts-title' );
+ astra_css( 'astra-settings[related-posts-background-color]', 'background-color', '.ast-single-related-posts-container' );
+ astra_css( 'astra-settings[related-posts-link-color]', 'color', '.ast-related-post-content .ast-related-post-cta a' );
+ astra_css( 'astra-settings[related-posts-link-hover-color]', 'color', '.ast-related-post-content .ast-related-post-cta a:hover' );
+ astra_css( 'astra-settings[related-posts-meta-link-hover-color]', 'color', '.ast-related-post-content .entry-meta a:hover, .ast-related-post-content .entry-meta span a span:hover' );
+
+ // Related Posts - Customizer preview for Post Title.
+ astra_generate_outside_font_family_css( 'astra-settings[related-posts-title-font-family]', '.ast-related-post-content .entry-header .ast-related-post-title, .ast-related-post-content .entry-header .ast-related-post-title a' );
+ astra_css( 'astra-settings[related-posts-title-font-weight]', 'font-weight', '.ast-related-post-content .entry-header .ast-related-post-title, .ast-related-post-content .entry-header .ast-related-post-title a' );
+ astra_responsive_font_size( 'astra-settings[related-posts-title-font-size]', '.ast-related-post-content .entry-header .ast-related-post-title, .ast-related-post-content .entry-header .ast-related-post-title a' );
+ astra_css( 'astra-settings[related-posts-title-line-height]', 'line-height', '.ast-related-post-content .entry-header .ast-related-post-title, .ast-related-post-content .entry-header .ast-related-post-title a' );
+ astra_css( 'astra-settings[related-posts-title-text-transform]', 'text-transform', '.ast-related-post-content .entry-header .ast-related-post-title, .ast-related-post-content .entry-header .ast-related-post-title a' );
+
+ // Related Posts - Customizer preview for Section Title.
+ astra_generate_outside_font_family_css( 'astra-settings[related-posts-section-title-font-family]', '.ast-single-related-posts-container .ast-related-posts-title-section .ast-related-posts-title' );
+ astra_css( 'astra-settings[related-posts-section-title-font-weight]', 'font-weight', '.ast-single-related-posts-container .ast-related-posts-title-section .ast-related-posts-title' );
+ astra_responsive_font_size( 'astra-settings[related-posts-section-title-font-size]', '.ast-single-related-posts-container .ast-related-posts-title-section .ast-related-posts-title' );
+ astra_css( 'astra-settings[related-posts-section-title-line-height]', 'line-height', '.ast-single-related-posts-container .ast-related-posts-title-section .ast-related-posts-title' );
+ astra_css( 'astra-settings[related-posts-section-title-text-transform]', 'text-transform', '.ast-single-related-posts-container .ast-related-posts-title-section .ast-related-posts-title' );
+ astra_css( 'astra-settings[releted-posts-title-alignment]', 'text-align', '.ast-single-related-posts-container .ast-related-posts-title-section .ast-related-posts-title' );
+
+ // Related Posts - Customizer preview for Post Meta.
+ astra_generate_outside_font_family_css( 'astra-settings[related-posts-meta-font-family]', '.ast-related-post-content .entry-meta, .ast-related-post-content .entry-meta *' );
+ astra_css( 'astra-settings[related-posts-meta-font-weight]', 'font-weight', '.ast-related-post-content .entry-meta, .ast-related-post-content .entry-meta *' );
+ astra_responsive_font_size( 'astra-settings[related-posts-meta-font-size]', '.ast-related-post-content .entry-meta, .ast-related-post-content .entry-meta *' );
+ astra_css( 'astra-settings[related-posts-meta-line-height]', 'line-height', '.ast-related-post-content .entry-meta, .ast-related-post-content .entry-meta *' );
+ astra_css( 'astra-settings[related-posts-meta-text-transform]', 'text-transform', '.ast-related-post-content .entry-meta, .ast-related-post-content .entry-meta *' );
+
+ // Related Posts - Customizer preview for Post Content.
+ astra_generate_outside_font_family_css( 'astra-settings[related-posts-content-font-family]', '.ast-related-post-content .ast-related-post-excerpt' );
+ astra_css( 'astra-settings[related-posts-content-font-weight]', 'font-weight', '.ast-related-post-content .ast-related-post-excerpt' );
+ astra_responsive_font_size( 'astra-settings[related-posts-content-font-size]', '.ast-related-post-content .ast-related-post-excerpt' );
+ astra_css( 'astra-settings[related-posts-content-line-height]', 'line-height', '.ast-related-post-content .ast-related-post-excerpt' );
+ astra_css( 'astra-settings[related-posts-content-text-transform]', 'text-transform', '.ast-related-post-content .ast-related-post-excerpt' );
+
+ // Title Color.
+ astra_css(
+ 'astra-settings[header-color-site-title]',
+ 'color',
+ '.ast-site-identity .site-title a, .ast-site-identity .site-title'
+ );
+
+ // Title Hover Color.
+ astra_css(
+ 'astra-settings[header-color-h-site-title]',
+ 'color',
+ '.ast-site-identity .site-title a:hover, .ast-site-identity .site-title:hover'
+ );
+
+ // Tagline Color.
+ astra_css(
+ 'astra-settings[header-color-site-tagline]',
+ 'color',
+ '.ast-site-identity .site-description'
+ );
+
+} )( jQuery );
diff --git a/assets/js/unminified/extend-customizer.js b/assets/js/unminified/extend-customizer.js
new file mode 100644
index 0000000..e82d516
--- /dev/null
+++ b/assets/js/unminified/extend-customizer.js
@@ -0,0 +1,349 @@
+/**
+ * Extend Customizer Panel
+ *
+ * @package Astra
+ */
+
+( function( $ ) {
+
+ var api = wp.customize;
+
+ api.bind( 'pane-contents-reflowed', function() {
+
+ // Reflow sections
+ var sections = [];
+
+ api.section.each( function( section ) {
+
+ if (
+ 'ast_section' !== section.params.type ||
+ 'undefined' === typeof section.params.section
+ ) {
+
+ return;
+
+ }
+
+ sections.push( section );
+
+ });
+
+ sections.sort( api.utils.prioritySort ).reverse();
+
+ $.each( sections, function( i, section ) {
+
+ var parentContainer = $( '#sub-accordion-section-' + section.params.section );
+
+ parentContainer.children( '.section-meta' ).after( section.headContainer );
+
+ });
+
+ // Reflow panels
+ var panels = [];
+
+ api.panel.each( function( panel ) {
+
+ if (
+ 'ast_panel' !== panel.params.type ||
+ 'undefined' === typeof panel.params.panel
+ ) {
+
+ return;
+
+ }
+
+ panels.push( panel );
+
+ });
+
+ panels.sort( api.utils.prioritySort ).reverse();
+
+ $.each( panels, function( i, panel ) {
+
+ var parentContainer = $( '#sub-accordion-panel-' + panel.params.panel );
+
+ parentContainer.children( '.panel-meta' ).after( panel.headContainer );
+
+ });
+
+ });
+
+
+ // Extend Panel
+ var _panelEmbed = wp.customize.Panel.prototype.embed;
+ var _panelIsContextuallyActive = wp.customize.Panel.prototype.isContextuallyActive;
+ var _panelAttachEvents = wp.customize.Panel.prototype.attachEvents;
+
+ wp.customize.Panel = wp.customize.Panel.extend({
+ attachEvents: function() {
+
+ if (
+ 'ast_panel' !== this.params.type ||
+ 'undefined' === typeof this.params.panel
+ ) {
+
+ _panelAttachEvents.call( this );
+
+ return;
+
+ }
+
+ _panelAttachEvents.call( this );
+
+ var panel = this;
+
+ panel.expanded.bind( function( expanded ) {
+
+ var parent = api.panel( panel.params.panel );
+
+ if ( expanded ) {
+
+ parent.contentContainer.addClass( 'current-panel-parent' );
+
+ } else {
+
+ parent.contentContainer.removeClass( 'current-panel-parent' );
+
+ }
+
+ });
+
+ panel.container.find( '.customize-panel-back' )
+ .off( 'click keydown' )
+ .on( 'click keydown', function( event ) {
+
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+
+ return;
+
+ }
+
+ event.preventDefault(); // Keep this AFTER the key filter above
+
+ if ( panel.expanded() ) {
+
+ api.panel( panel.params.panel ).expand();
+
+ }
+
+ });
+
+ },
+ embed: function() {
+
+ if (
+ 'ast_panel' !== this.params.type ||
+ 'undefined' === typeof this.params.panel
+ ) {
+
+ _panelEmbed.call( this );
+
+ return;
+
+ }
+
+ _panelEmbed.call( this );
+
+ var panel = this;
+ var parentContainer = $( '#sub-accordion-panel-' + this.params.panel );
+
+ parentContainer.append( panel.headContainer );
+
+ },
+ isContextuallyActive: function() {
+
+ if (
+ 'ast_panel' !== this.params.type
+ ) {
+
+ return _panelIsContextuallyActive.call( this );
+
+ }
+
+ var panel = this;
+ var children = this._children( 'panel', 'section' );
+
+ api.panel.each( function( child ) {
+
+ if ( ! child.params.panel ) {
+
+ return;
+
+ }
+
+ if ( child.params.panel !== panel.id ) {
+
+ return;
+
+ }
+
+ children.push( child );
+
+ });
+
+ children.sort( api.utils.prioritySort );
+
+ var activeCount = 0;
+
+ _( children ).each( function ( child ) {
+
+ if ( child.active() && child.isContextuallyActive() ) {
+
+ activeCount += 1;
+
+ }
+
+ });
+
+ return ( activeCount !== 0 );
+
+ }
+
+ });
+
+
+ // Extend Section
+ var _sectionEmbed = wp.customize.Section.prototype.embed;
+ var _sectionIsContextuallyActive = wp.customize.Section.prototype.isContextuallyActive;
+ var _sectionAttachEvents = wp.customize.Section.prototype.attachEvents;
+
+ wp.customize.Section = wp.customize.Section.extend({
+ attachEvents: function() {
+
+ if (
+ 'ast_section' !== this.params.type ||
+ 'undefined' === typeof this.params.section
+ ) {
+
+ _sectionAttachEvents.call( this );
+
+ return;
+
+ }
+
+ _sectionAttachEvents.call( this );
+
+ var section = this;
+
+ section.expanded.bind( function( expanded ) {
+
+ var parent = api.section( section.params.section );
+
+ if ( expanded ) {
+
+ parent.contentContainer.addClass( 'current-section-parent' );
+
+ } else {
+
+ parent.contentContainer.removeClass( 'current-section-parent' );
+
+ }
+
+ });
+
+ section.container.find( '.customize-section-back' )
+ .off( 'click keydown' )
+ .on( 'click keydown', function( event ) {
+
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
+
+ return;
+
+ }
+
+ event.preventDefault(); // Keep this AFTER the key filter above
+
+ if ( section.expanded() ) {
+
+ api.section( section.params.section ).expand();
+
+ }
+
+ });
+
+ },
+ embed: function() {
+
+ if (
+ 'ast_section' !== this.params.type ||
+ 'undefined' === typeof this.params.section
+ ) {
+
+ _sectionEmbed.call( this );
+
+ return;
+
+ }
+
+ _sectionEmbed.call( this );
+
+ var section = this;
+ var parentContainer = $( '#sub-accordion-section-' + this.params.section );
+
+ parentContainer.append( section.headContainer );
+
+ },
+ isContextuallyActive: function() {
+
+ if (
+ 'ast_section' !== this.params.type
+ ) {
+
+ return _sectionIsContextuallyActive.call( this );
+
+ }
+
+ var section = this;
+ var children = this._children( 'section', 'control' );
+
+ api.section.each( function( child ) {
+
+ if ( ! child.params.section ) {
+
+ return;
+
+ }
+
+ if ( child.params.section !== section.id ) {
+
+ return;
+
+ }
+
+ children.push( child );
+
+ });
+
+ children.sort( api.utils.prioritySort );
+
+ var activeCount = 0;
+
+ _( children ).each( function ( child ) {
+
+ if ( 'undefined' !== typeof child.isContextuallyActive ) {
+
+ if ( child.active() && child.isContextuallyActive() ) {
+
+ activeCount += 1;
+
+ }
+
+ } else {
+
+ if ( child.active() ) {
+
+ activeCount += 1;
+
+ }
+
+ }
+
+ });
+
+ return ( activeCount !== 0 );
+
+ }
+
+ });
+
+})( jQuery ); \ No newline at end of file
diff --git a/assets/js/unminified/flexibility.js b/assets/js/unminified/flexibility.js
new file mode 100644
index 0000000..ec34e1b
--- /dev/null
+++ b/assets/js/unminified/flexibility.js
@@ -0,0 +1,466 @@
+/**
+ * Flexibility is a JavaScript polyfill for Flexbox By Jonathan Neal, 10up. (https://github.com/jonathantneal/flexibility)
+ * Licensed under MIT ( https://github.com/jonathantneal/flexibility/blob/master/LICENSE.md )
+ */
+! function(e) {
+ if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
+ else if ("function" == typeof define && define.amd) define([], e);
+ else {
+ var t;
+ t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.flexibility = e()
+ }
+}(function() {
+ return function e(t, r, l) {
+ function n(f, i) {
+ if (!r[f]) {
+ if (!t[f]) {
+ var s = "function" == typeof require && require;
+ if (!i && s) return s(f, !0);
+ if (o) return o(f, !0);
+ var a = new Error("Cannot find module '" + f + "'");
+ throw a.code = "MODULE_NOT_FOUND", a
+ }
+ var c = r[f] = {
+ exports: {}
+ };
+ t[f][0].call(c.exports, function(e) {
+ var r = t[f][1][e];
+ return n(r ? r : e)
+ }, c, c.exports, e, t, r, l)
+ }
+ return r[f].exports
+ }
+ for (var o = "function" == typeof require && require, f = 0; f < l.length; f++) n(l[f]);
+ return n
+ }({
+ 1: [function(e, t, r) {
+ t.exports = function(e) {
+ var t, r, l, n = -1;
+ if (e.lines.length > 1 && "flex-start" === e.style.alignContent)
+ for (t = 0; l = e.lines[++n];) l.crossStart = t, t += l.cross;
+ else if (e.lines.length > 1 && "flex-end" === e.style.alignContent)
+ for (t = e.flexStyle.crossSpace; l = e.lines[++n];) l.crossStart = t, t += l.cross;
+ else if (e.lines.length > 1 && "center" === e.style.alignContent)
+ for (t = e.flexStyle.crossSpace / 2; l = e.lines[++n];) l.crossStart = t, t += l.cross;
+ else if (e.lines.length > 1 && "space-between" === e.style.alignContent)
+ for (r = e.flexStyle.crossSpace / (e.lines.length - 1), t = 0; l = e.lines[++n];) l.crossStart = t, t += l.cross + r;
+ else if (e.lines.length > 1 && "space-around" === e.style.alignContent)
+ for (r = 2 * e.flexStyle.crossSpace / (2 * e.lines.length), t = r / 2; l = e.lines[++n];) l.crossStart = t, t += l.cross + r;
+ else
+ for (r = e.flexStyle.crossSpace / e.lines.length, t = e.flexStyle.crossInnerBefore; l = e.lines[++n];) l.crossStart = t, l.cross += r, t += l.cross
+ }
+ }, {}],
+ 2: [function(e, t, r) {
+ t.exports = function(e) {
+ for (var t, r = -1; line = e.lines[++r];)
+ for (t = -1; child = line.children[++t];) {
+ var l = child.style.alignSelf;
+ "auto" === l && (l = e.style.alignItems), "flex-start" === l ? child.flexStyle.crossStart = line.crossStart : "flex-end" === l ? child.flexStyle.crossStart = line.crossStart + line.cross - child.flexStyle.crossOuter : "center" === l ? child.flexStyle.crossStart = line.crossStart + (line.cross - child.flexStyle.crossOuter) / 2 : (child.flexStyle.crossStart = line.crossStart, child.flexStyle.crossOuter = line.cross, child.flexStyle.cross = child.flexStyle.crossOuter - child.flexStyle.crossBefore - child.flexStyle.crossAfter)
+ }
+ }
+ }, {}],
+ 3: [function(e, t, r) {
+ t.exports = function l(e, l) {
+ var t = "row" === l || "row-reverse" === l,
+ r = e.mainAxis;
+ if (r) {
+ var n = t && "inline" === r || !t && "block" === r;
+ n || (e.flexStyle = {
+ main: e.flexStyle.cross,
+ cross: e.flexStyle.main,
+ mainOffset: e.flexStyle.crossOffset,
+ crossOffset: e.flexStyle.mainOffset,
+ mainBefore: e.flexStyle.crossBefore,
+ mainAfter: e.flexStyle.crossAfter,
+ crossBefore: e.flexStyle.mainBefore,
+ crossAfter: e.flexStyle.mainAfter,
+ mainInnerBefore: e.flexStyle.crossInnerBefore,
+ mainInnerAfter: e.flexStyle.crossInnerAfter,
+ crossInnerBefore: e.flexStyle.mainInnerBefore,
+ crossInnerAfter: e.flexStyle.mainInnerAfter,
+ mainBorderBefore: e.flexStyle.crossBorderBefore,
+ mainBorderAfter: e.flexStyle.crossBorderAfter,
+ crossBorderBefore: e.flexStyle.mainBorderBefore,
+ crossBorderAfter: e.flexStyle.mainBorderAfter
+ })
+ } else t ? e.flexStyle = {
+ main: e.style.width,
+ cross: e.style.height,
+ mainOffset: e.style.offsetWidth,
+ crossOffset: e.style.offsetHeight,
+ mainBefore: e.style.marginLeft,
+ mainAfter: e.style.marginRight,
+ crossBefore: e.style.marginTop,
+ crossAfter: e.style.marginBottom,
+ mainInnerBefore: e.style.paddingLeft,
+ mainInnerAfter: e.style.paddingRight,
+ crossInnerBefore: e.style.paddingTop,
+ crossInnerAfter: e.style.paddingBottom,
+ mainBorderBefore: e.style.borderLeftWidth,
+ mainBorderAfter: e.style.borderRightWidth,
+ crossBorderBefore: e.style.borderTopWidth,
+ crossBorderAfter: e.style.borderBottomWidth
+ } : e.flexStyle = {
+ main: e.style.height,
+ cross: e.style.width,
+ mainOffset: e.style.offsetHeight,
+ crossOffset: e.style.offsetWidth,
+ mainBefore: e.style.marginTop,
+ mainAfter: e.style.marginBottom,
+ crossBefore: e.style.marginLeft,
+ crossAfter: e.style.marginRight,
+ mainInnerBefore: e.style.paddingTop,
+ mainInnerAfter: e.style.paddingBottom,
+ crossInnerBefore: e.style.paddingLeft,
+ crossInnerAfter: e.style.paddingRight,
+ mainBorderBefore: e.style.borderTopWidth,
+ mainBorderAfter: e.style.borderBottomWidth,
+ crossBorderBefore: e.style.borderLeftWidth,
+ crossBorderAfter: e.style.borderRightWidth
+ }, "content-box" === e.style.boxSizing && ("number" == typeof e.flexStyle.main && (e.flexStyle.main += e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter), "number" == typeof e.flexStyle.cross && (e.flexStyle.cross += e.flexStyle.crossInnerBefore + e.flexStyle.crossInnerAfter + e.flexStyle.crossBorderBefore + e.flexStyle.crossBorderAfter));
+ e.mainAxis = t ? "inline" : "block", e.crossAxis = t ? "block" : "inline", "number" == typeof e.style.flexBasis && (e.flexStyle.main = e.style.flexBasis + e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter), e.flexStyle.mainOuter = e.flexStyle.main, e.flexStyle.crossOuter = e.flexStyle.cross, "auto" === e.flexStyle.mainOuter && (e.flexStyle.mainOuter = e.flexStyle.mainOffset), "auto" === e.flexStyle.crossOuter && (e.flexStyle.crossOuter = e.flexStyle.crossOffset), "number" == typeof e.flexStyle.mainBefore && (e.flexStyle.mainOuter += e.flexStyle.mainBefore), "number" == typeof e.flexStyle.mainAfter && (e.flexStyle.mainOuter += e.flexStyle.mainAfter), "number" == typeof e.flexStyle.crossBefore && (e.flexStyle.crossOuter += e.flexStyle.crossBefore), "number" == typeof e.flexStyle.crossAfter && (e.flexStyle.crossOuter += e.flexStyle.crossAfter)
+ }
+ }, {}],
+ 4: [function(e, t, r) {
+ var l = e("../reduce");
+ t.exports = function(e) {
+ if (e.mainSpace > 0) {
+ var t = l(e.children, function(e, t) {
+ return e + parseFloat(t.style.flexGrow)
+ }, 0);
+ t > 0 && (e.main = l(e.children, function(r, l) {
+ return "auto" === l.flexStyle.main ? l.flexStyle.main = l.flexStyle.mainOffset + parseFloat(l.style.flexGrow) / t * e.mainSpace : l.flexStyle.main += parseFloat(l.style.flexGrow) / t * e.mainSpace, l.flexStyle.mainOuter = l.flexStyle.main + l.flexStyle.mainBefore + l.flexStyle.mainAfter, r + l.flexStyle.mainOuter
+ }, 0), e.mainSpace = 0)
+ }
+ }
+ }, {
+ "../reduce": 12
+ }],
+ 5: [function(e, t, r) {
+ var l = e("../reduce");
+ t.exports = function(e) {
+ if (e.mainSpace < 0) {
+ var t = l(e.children, function(e, t) {
+ return e + parseFloat(t.style.flexShrink)
+ }, 0);
+ t > 0 && (e.main = l(e.children, function(r, l) {
+ return l.flexStyle.main += parseFloat(l.style.flexShrink) / t * e.mainSpace, l.flexStyle.mainOuter = l.flexStyle.main + l.flexStyle.mainBefore + l.flexStyle.mainAfter, r + l.flexStyle.mainOuter
+ }, 0), e.mainSpace = 0)
+ }
+ }
+ }, {
+ "../reduce": 12
+ }],
+ 6: [function(e, t, r) {
+ var l = e("../reduce");
+ t.exports = function(e) {
+ var t;
+ e.lines = [t = {
+ main: 0,
+ cross: 0,
+ children: []
+ }];
+ for (var r, n = -1; r = e.children[++n];) "nowrap" === e.style.flexWrap || 0 === t.children.length || "auto" === e.flexStyle.main || e.flexStyle.main - e.flexStyle.mainInnerBefore - e.flexStyle.mainInnerAfter - e.flexStyle.mainBorderBefore - e.flexStyle.mainBorderAfter >= t.main + r.flexStyle.mainOuter ? (t.main += r.flexStyle.mainOuter, t.cross = Math.max(t.cross, r.flexStyle.crossOuter)) : e.lines.push(t = {
+ main: r.flexStyle.mainOuter,
+ cross: r.flexStyle.crossOuter,
+ children: []
+ }), t.children.push(r);
+ e.flexStyle.mainLines = l(e.lines, function(e, t) {
+ return Math.max(e, t.main)
+ }, 0), e.flexStyle.crossLines = l(e.lines, function(e, t) {
+ return e + t.cross
+ }, 0), "auto" === e.flexStyle.main && (e.flexStyle.main = Math.max(e.flexStyle.mainOffset, e.flexStyle.mainLines + e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter)), "auto" === e.flexStyle.cross && (e.flexStyle.cross = Math.max(e.flexStyle.crossOffset, e.flexStyle.crossLines + e.flexStyle.crossInnerBefore + e.flexStyle.crossInnerAfter + e.flexStyle.crossBorderBefore + e.flexStyle.crossBorderAfter)), e.flexStyle.crossSpace = e.flexStyle.cross - e.flexStyle.crossInnerBefore - e.flexStyle.crossInnerAfter - e.flexStyle.crossBorderBefore - e.flexStyle.crossBorderAfter - e.flexStyle.crossLines, e.flexStyle.mainOuter = e.flexStyle.main + e.flexStyle.mainBefore + e.flexStyle.mainAfter, e.flexStyle.crossOuter = e.flexStyle.cross + e.flexStyle.crossBefore + e.flexStyle.crossAfter
+ }
+ }, {
+ "../reduce": 12
+ }],
+ 7: [function(e, t, r) {
+ function l(t) {
+ for (var r, l = -1; r = t.children[++l];) e("./flex-direction")(r, t.style.flexDirection);
+ e("./flex-direction")(t, t.style.flexDirection), e("./order")(t), e("./flexbox-lines")(t), e("./align-content")(t), l = -1;
+ for (var n; n = t.lines[++l];) n.mainSpace = t.flexStyle.main - t.flexStyle.mainInnerBefore - t.flexStyle.mainInnerAfter - t.flexStyle.mainBorderBefore - t.flexStyle.mainBorderAfter - n.main, e("./flex-grow")(n), e("./flex-shrink")(n), e("./margin-main")(n), e("./margin-cross")(n), e("./justify-content")(n, t.style.justifyContent, t);
+ e("./align-items")(t)
+ }
+ t.exports = l
+ }, {
+ "./align-content": 1,
+ "./align-items": 2,
+ "./flex-direction": 3,
+ "./flex-grow": 4,
+ "./flex-shrink": 5,
+ "./flexbox-lines": 6,
+ "./justify-content": 8,
+ "./margin-cross": 9,
+ "./margin-main": 10,
+ "./order": 11
+ }],
+ 8: [function(e, t, r) {
+ t.exports = function(e, t, r) {
+ var l, n, o, f = r.flexStyle.mainInnerBefore,
+ i = -1;
+ if ("flex-end" === t)
+ for (l = e.mainSpace, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter;
+ else if ("center" === t)
+ for (l = e.mainSpace / 2, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter;
+ else if ("space-between" === t)
+ for (n = e.mainSpace / (e.children.length - 1), l = 0, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter + n;
+ else if ("space-around" === t)
+ for (n = 2 * e.mainSpace / (2 * e.children.length), l = n / 2, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter + n;
+ else
+ for (l = 0, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter
+ }
+ }, {}],
+ 9: [function(e, t, r) {
+ t.exports = function(e) {
+ for (var t, r = -1; t = e.children[++r];) {
+ var l = 0;
+ "auto" === t.flexStyle.crossBefore && ++l, "auto" === t.flexStyle.crossAfter && ++l;
+ var n = e.cross - t.flexStyle.crossOuter;
+ "auto" === t.flexStyle.crossBefore && (t.flexStyle.crossBefore = n / l), "auto" === t.flexStyle.crossAfter && (t.flexStyle.crossAfter = n / l), "auto" === t.flexStyle.cross ? t.flexStyle.crossOuter = t.flexStyle.crossOffset + t.flexStyle.crossBefore + t.flexStyle.crossAfter : t.flexStyle.crossOuter = t.flexStyle.cross + t.flexStyle.crossBefore + t.flexStyle.crossAfter
+ }
+ }
+ }, {}],
+ 10: [function(e, t, r) {
+ t.exports = function(e) {
+ for (var t, r = 0, l = -1; t = e.children[++l];) "auto" === t.flexStyle.mainBefore && ++r, "auto" === t.flexStyle.mainAfter && ++r;
+ if (r > 0) {
+ for (l = -1; t = e.children[++l];) "auto" === t.flexStyle.mainBefore && (t.flexStyle.mainBefore = e.mainSpace / r), "auto" === t.flexStyle.mainAfter && (t.flexStyle.mainAfter = e.mainSpace / r), "auto" === t.flexStyle.main ? t.flexStyle.mainOuter = t.flexStyle.mainOffset + t.flexStyle.mainBefore + t.flexStyle.mainAfter : t.flexStyle.mainOuter = t.flexStyle.main + t.flexStyle.mainBefore + t.flexStyle.mainAfter;
+ e.mainSpace = 0
+ }
+ }
+ }, {}],
+ 11: [function(e, t, r) {
+ var l = /^(column|row)-reverse$/;
+ t.exports = function(e) {
+ e.children.sort(function(e, t) {
+ return e.style.order - t.style.order || e.index - t.index
+ }), l.test(e.style.flexDirection) && e.children.reverse()
+ }
+ }, {}],
+ 12: [function(e, t, r) {
+ function l(e, t, r) {
+ for (var l = e.length, n = -1; ++n < l;) n in e && (r = t(r, e[n], n));
+ return r
+ }
+ t.exports = l
+ }, {}],
+ 13: [function(e, t, r) {
+ function l(e) {
+ i(f(e))
+ }
+ var n = e("./read"),
+ o = e("./write"),
+ f = e("./readAll"),
+ i = e("./writeAll");
+ t.exports = l, t.exports.read = n, t.exports.write = o, t.exports.readAll = f, t.exports.writeAll = i
+ }, {
+ "./read": 15,
+ "./readAll": 16,
+ "./write": 17,
+ "./writeAll": 18
+ }],
+ 14: [function(e, t, r) {
+ function l(e, t, r) {
+ var l = e[t],
+ f = String(l).match(o);
+ if (!f) {
+ var a = t.match(s);
+ if (a) {
+ var c = e["border" + a[1] + "Style"];
+ return "none" === c ? 0 : i[l] || 0
+ }
+ return l
+ }
+ var y = f[1],
+ x = f[2];
+ return "px" === x ? 1 * y : "cm" === x ? .3937 * y * 96 : "in" === x ? 96 * y : "mm" === x ? .3937 * y * 96 / 10 : "pc" === x ? 12 * y * 96 / 72 : "pt" === x ? 96 * y / 72 : "rem" === x ? 16 * y : n(l, r)
+ }
+
+ function n(e, t) {
+ f.style.cssText = "border:none!important;clip:rect(0 0 0 0)!important;display:block!important;font-size:1em!important;height:0!important;margin:0!important;padding:0!important;position:relative!important;width:" + e + "!important", t.parentNode.insertBefore(f, t.nextSibling);
+ var r = f.offsetWidth;
+ return t.parentNode.removeChild(f), r
+ }
+ t.exports = l;
+ var o = /^([-+]?\d*\.?\d+)(%|[a-z]+)$/,
+ f = document.createElement("div"),
+ i = {
+ medium: 4,
+ none: 0,
+ thick: 6,
+ thin: 2
+ },
+ s = /^border(Bottom|Left|Right|Top)Width$/
+ }, {}],
+ 15: [function(e, t, r) {
+ function l(e) {
+ var t = {
+ alignContent: "stretch",
+ alignItems: "stretch",
+ alignSelf: "auto",
+ borderBottomStyle: "none",
+ borderBottomWidth: 0,
+ borderLeftStyle: "none",
+ borderLeftWidth: 0,
+ borderRightStyle: "none",
+ borderRightWidth: 0,
+ borderTopStyle: "none",
+ borderTopWidth: 0,
+ boxSizing: "content-box",
+ display: "inline",
+ flexBasis: "auto",
+ flexDirection: "row",
+ flexGrow: 0,
+ flexShrink: 1,
+ flexWrap: "nowrap",
+ justifyContent: "flex-start",
+ height: "auto",
+ marginTop: 0,
+ marginRight: 0,
+ marginLeft: 0,
+ marginBottom: 0,
+ paddingTop: 0,
+ paddingRight: 0,
+ paddingLeft: 0,
+ paddingBottom: 0,
+ maxHeight: "none",
+ maxWidth: "none",
+ minHeight: 0,
+ minWidth: 0,
+ order: 0,
+ position: "static",
+ width: "auto"
+ },
+ r = e instanceof Element;
+ if (r) {
+ var l = e.hasAttribute("data-style"),
+ i = l ? e.getAttribute("data-style") : e.getAttribute("style") || "";
+ l || e.setAttribute("data-style", i);
+ var s = window.getComputedStyle && getComputedStyle(e) || {};
+ f(t, s);
+ var c = e.currentStyle || {};
+ n(t, c), o(t, i);
+ for (var y in t) t[y] = a(t, y, e);
+ var x = e.getBoundingClientRect();
+ t.offsetHeight = x.height || e.offsetHeight, t.offsetWidth = x.width || e.offsetWidth
+ }
+ var S = {
+ element: e,
+ style: t
+ };
+ return S
+ }
+
+ function n(e, t) {
+ for (var r in e) {
+ var l = r in t;
+ if (l) e[r] = t[r];
+ else {
+ // Replace uppercase characters with lowercase.
+ var n = r.replace(/[A-Z]/g, "-$&").toLowerCase(),
+ o = n in t;
+ o && (e[r] = t[n])
+ }
+ }
+ var f = "-js-display" in t;
+ f && (e.display = t["-js-display"])
+ }
+
+ function o(e, t) {
+ for (var r; r = i.exec(t);) {
+ // Replace lowercase characters with uppercase.
+ var l = r[1].toLowerCase().replace(/-[a-z]/g, function(e) {
+ return e.slice(1).toUpperCase()
+ });
+ e[l] = r[2]
+ }
+ }
+
+ function f(e, t) {
+ for (var r in e) {
+ var l = r in t;
+ l && !s.test(r) && (e[r] = t[r])
+ }
+ }
+ t.exports = l;
+ var i = /([^\s:;]+)\s*:\s*([^;]+?)\s*(;|$)/g,
+ s = /^(alignSelf|height|width)$/,
+ a = e("./getComputedLength")
+ }, {
+ "./getComputedLength": 14
+ }],
+ 16: [function(e, t, r) {
+ function l(e) {
+ var t = [];
+ return n(e, t), t
+ }
+
+ function n(e, t) {
+ for (var r, l = o(e), i = [], s = -1; r = e.childNodes[++s];) {
+ var a = 3 === r.nodeType && !/^\s*$/.test(r.nodeValue);
+ if (l && a) {
+ var c = r;
+ r = e.insertBefore(document.createElement("flex-item"), c), r.appendChild(c)
+ }
+ var y = r instanceof Element;
+ if (y) {
+ var x = n(r, t);
+ if (l) {
+ var S = r.style;
+ S.display = "inline-block", S.position = "absolute", x.style = f(r).style, i.push(x)
+ }
+ }
+ }
+ var m = {
+ element: e,
+ children: i
+ };
+ return l && (m.style = f(e).style, t.push(m)), m
+ }
+
+ function o(e) {
+ var t = e instanceof Element,
+ r = t && e.getAttribute("data-style"),
+ l = t && e.currentStyle && e.currentStyle["-js-display"],
+ n = i.test(r) || s.test(l);
+ return n
+ }
+ t.exports = l;
+ var f = e("../read"),
+ i = /(^|;)\s*display\s*:\s*(inline-)?flex\s*(;|$)/i,
+ s = /^(inline-)?flex$/i
+ }, {
+ "../read": 15
+ }],
+ 17: [function(e, t, r) {
+ function l(e) {
+ o(e);
+ var t = e.element.style,
+ r = "inline" === e.mainAxis ? ["main", "cross"] : ["cross", "main"];
+ t.boxSizing = "content-box", t.display = "block", t.position = "relative", t.width = n(e.flexStyle[r[0]] - e.flexStyle[r[0] + "InnerBefore"] - e.flexStyle[r[0] + "InnerAfter"] - e.flexStyle[r[0] + "BorderBefore"] - e.flexStyle[r[0] + "BorderAfter"]), t.height = n(e.flexStyle[r[1]] - e.flexStyle[r[1] + "InnerBefore"] - e.flexStyle[r[1] + "InnerAfter"] - e.flexStyle[r[1] + "BorderBefore"] - e.flexStyle[r[1] + "BorderAfter"]);
+ for (var l, f = -1; l = e.children[++f];) {
+ var i = l.element.style,
+ s = "inline" === l.mainAxis ? ["main", "cross"] : ["cross", "main"];
+ i.boxSizing = "content-box", i.display = "block", i.position = "absolute", "auto" !== l.flexStyle[s[0]] && (i.width = n(l.flexStyle[s[0]] - l.flexStyle[s[0] + "InnerBefore"] - l.flexStyle[s[0] + "InnerAfter"] - l.flexStyle[s[0] + "BorderBefore"] - l.flexStyle[s[0] + "BorderAfter"])), "auto" !== l.flexStyle[s[1]] && (i.height = n(l.flexStyle[s[1]] - l.flexStyle[s[1] + "InnerBefore"] - l.flexStyle[s[1] + "InnerAfter"] - l.flexStyle[s[1] + "BorderBefore"] - l.flexStyle[s[1] + "BorderAfter"])), i.top = n(l.flexStyle[s[1] + "Start"]), i.left = n(l.flexStyle[s[0] + "Start"]), i.marginTop = n(l.flexStyle[s[1] + "Before"]), i.marginRight = n(l.flexStyle[s[0] + "After"]), i.marginBottom = n(l.flexStyle[s[1] + "After"]), i.marginLeft = n(l.flexStyle[s[0] + "Before"])
+ }
+ }
+
+ function n(e) {
+ return "string" == typeof e ? e : Math.max(e, 0) + "px"
+ }
+ t.exports = l;
+ var o = e("../flexbox")
+ }, {
+ "../flexbox": 7
+ }],
+ 18: [function(e, t, r) {
+ function l(e) {
+ for (var t, r = -1; t = e[++r];) n(t)
+ }
+ t.exports = l;
+ var n = e("../write")
+ }, {
+ "../write": 17
+ }]
+ }, {}, [13])(13)
+});
diff --git a/assets/js/unminified/frontend.js b/assets/js/unminified/frontend.js
new file mode 100644
index 0000000..e0c9dc4
--- /dev/null
+++ b/assets/js/unminified/frontend.js
@@ -0,0 +1,976 @@
+/**
+ * File fronend.js
+ *
+ * Handles toggling the navigation menu for small screens and enables tab
+ * support for dropdown menus.
+ *
+ * @package Astra
+ */
+
+/**
+ * Get all of an element's parent elements up the DOM tree
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var astraGetParents = function ( elem, selector ) {
+
+ // Element.matches() polyfill.
+ if ( ! Element.prototype.matches) {
+ Element.prototype.matches =
+ Element.prototype.matchesSelector ||
+ Element.prototype.mozMatchesSelector ||
+ Element.prototype.msMatchesSelector ||
+ Element.prototype.oMatchesSelector ||
+ Element.prototype.webkitMatchesSelector ||
+ function(s) {
+ var matches = (this.document || this.ownerDocument).querySelectorAll( s ),
+ i = matches.length;
+ while (--i >= 0 && matches.item( i ) !== this) {}
+ return i > -1;
+ };
+ }
+
+ // Setup parents array.
+ var parents = [];
+
+ // Get matching parent elements.
+ for ( ; elem && elem !== document; elem = elem.parentNode ) {
+
+ // Add matching parents to array.
+ if ( selector ) {
+ if ( elem.matches( selector ) ) {
+ parents.push( elem );
+ }
+ } else {
+ parents.push( elem );
+ }
+ }
+ return parents;
+};
+
+/**
+ * Deprecated: Get all of an element's parent elements up the DOM tree
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var getParents = function ( elem, selector ) {
+ console.warn( 'getParents() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraGetParents() instead.' );
+ astraGetParents( elem, selector );
+}
+
+/**
+ * Toggle Class funtion
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var astraToggleClass = function ( el, className ) {
+ if ( el.classList.contains( className ) ) {
+ el.classList.remove( className );
+ } else {
+ el.classList.add( className );
+ }
+};
+
+/**
+ * Deprecated: Toggle Class funtion
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var toggleClass = function ( el, className ) {
+ console.warn( 'toggleClass() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraToggleClass() instead.' );
+ astraToggleClass( el, className );
+};
+
+// CustomEvent() constructor functionality in Internet Explorer 9 and higher.
+(function () {
+
+ if (typeof window.CustomEvent === "function") return false;
+ function CustomEvent(event, params) {
+ params = params || { bubbles: false, cancelable: false, detail: undefined };
+ var evt = document.createEvent('CustomEvent');
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
+ return evt;
+ }
+ CustomEvent.prototype = window.Event.prototype;
+ window.CustomEvent = CustomEvent;
+})();
+
+/**
+ * Trigget custom JS Event.
+ *
+ * @since 1.4.6
+ *
+ * @link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent
+ * @param {Node} el Dom Node element on which the event is to be triggered.
+ * @param {Node} typeArg A DOMString representing the name of the event.
+ * @param {String} A CustomEventInit dictionary, having the following fields:
+ * "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event.
+ */
+var astraTriggerEvent = function astraTriggerEvent( el, typeArg ) {
+ var customEventInit =
+ arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+
+ var event = new CustomEvent(typeArg, customEventInit);
+ el.dispatchEvent(event);
+};
+
+( function() {
+
+ var menu_toggle_all = document.querySelectorAll( '#masthead .main-header-menu-toggle' ),
+ main_header_masthead = document.getElementById('masthead'),
+ menu_click_listeners = {},
+ mobileHeaderType = '',
+ body = document.body,
+ mobileHeader = '';
+
+ if ( undefined !== main_header_masthead && null !== main_header_masthead ) {
+
+ mobileHeader = main_header_masthead.querySelector("#ast-mobile-header");
+ }
+
+ if ( '' !== mobileHeader && null !== mobileHeader ) {
+
+ mobileHeaderType = mobileHeader.dataset.type;
+ }
+
+ document.addEventListener( 'astMobileHeaderTypeChange', updateHeaderType, false );
+
+ /**
+ * Updates the header type.
+ */
+ function updateHeaderType( e ) {
+
+ mobileHeaderType = e.detail.type;
+ var popupTrigger = document.querySelectorAll( '.menu-toggle' );
+
+ if( 'dropdown' === mobileHeaderType ) {
+
+ document.getElementById( 'ast-mobile-popup' ).classList.remove( 'active', 'show' );
+ updateTrigger('updateHeader');
+ }
+
+ if ( 'off-canvas' === mobileHeaderType ) {
+
+ for ( var item = 0; item < popupTrigger.length; item++ ) {
+ if ( undefined !== popupTrigger[item] && popupTrigger[item].classList.contains( 'toggled') ) {
+ popupTrigger[item].click();
+ }
+ }
+ }
+
+ init( mobileHeaderType );
+
+ }
+
+ /**
+ * Opens the Popup when trigger is clicked.
+ */
+ popupTriggerClick = function ( event ) {
+
+ var triggerType = event.currentTarget.trigger_type;
+ var popupWrap = document.getElementById( 'ast-mobile-popup' );
+
+ if ( ! body.classList.contains( 'ast-popup-nav-open' ) ) {
+ body.classList.add( 'ast-popup-nav-open' );
+ }
+
+ if ( ! body.classList.contains( 'ast-main-header-nav-open' ) ) {
+ body.classList.add( 'ast-main-header-nav-open' );
+ }
+
+ if ( ! document.documentElement.classList.contains( 'ast-off-canvas-active' ) ) {
+ document.documentElement.classList.add( 'ast-off-canvas-active' );
+ }
+
+ if ( 'desktop' === triggerType ) {
+
+ popupWrap.querySelector( '.ast-mobile-popup-content' ).style.display = 'none';
+ popupWrap.querySelector( '.ast-desktop-popup-content' ).style.display = 'block';
+ }
+ if ( 'mobile' === triggerType ) {
+
+ popupWrap.querySelector( '.ast-desktop-popup-content' ).style.display = 'none';
+ popupWrap.querySelector( '.ast-mobile-popup-content' ).style.display = 'block';
+ }
+ this.style.display = 'none';
+
+ popupWrap.classList.add( 'active', 'show' );
+ }
+
+ /**
+ * Closes the Trigger when Popup is Closed.
+ */
+ function updateTrigger(currentElement) {
+
+ mobileHeader = main_header_masthead.querySelector( "#ast-mobile-header" );
+ var parent_li_sibling = '';
+
+ if( undefined !== mobileHeader && null !== mobileHeader && 'dropdown' === mobileHeader.dataset.type && 'updateHeader' !== currentElement ) {
+ return;
+ }
+ if ( undefined !== currentElement && 'updateHeader' !== currentElement ) {
+
+ parent_li_sibling = currentElement.closest( '.ast-mobile-popup-inner' ).querySelectorAll('.menu-item-has-children');
+
+ } else {
+ var popup = document.querySelector( '#ast-mobile-popup' );
+ parent_li_sibling = popup.querySelectorAll('.menu-item-has-children');
+
+ }
+
+ for ( var j = 0; j < parent_li_sibling.length; j++ ) {
+
+ parent_li_sibling[j].classList.remove('ast-submenu-expanded');
+
+ var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu');
+ for ( var k = 0; k < all_sub_menu.length; k++ ) {
+ all_sub_menu[k].style.display = 'none';
+ }
+ }
+
+ var popupTrigger = document.querySelectorAll( '.menu-toggle' );
+
+ document.body.classList.remove( 'ast-main-header-nav-open', 'ast-popup-nav-open' );
+ document.documentElement.classList.remove( 'ast-off-canvas-active' );
+
+ for ( var item = 0; item < popupTrigger.length; item++ ) {
+
+ popupTrigger[item].classList.remove( 'toggled' );
+
+ popupTrigger[item].style.display = 'flex';
+ }
+ }
+
+ /**
+ * Main Init Function.
+ */
+ function init( mobileHeaderType ) {
+
+ var popupTriggerMobile = document.querySelectorAll( '#ast-mobile-header .menu-toggle' );
+ var popupTriggerDesktop = document.querySelectorAll( '#ast-desktop-header .menu-toggle' );
+
+ if ( undefined === mobileHeaderType && null !== main_header_masthead ) {
+
+ mobileHeader = main_header_masthead.querySelector("#ast-mobile-header");
+ if( mobileHeader ) {
+ mobileHeaderType = mobileHeader.dataset.type;
+ } else {
+ var desktopHeader = main_header_masthead.querySelector("#ast-desktop-header");
+ if ( desktopHeader ) {
+
+ mobileHeaderType = desktopHeader.dataset.toggleType;
+ } else {
+ return;
+ }
+ }
+ }
+
+ if ( 'off-canvas' === mobileHeaderType ) {
+ var popupClose = document.getElementById( 'menu-toggle-close' ),
+ popupInner = document.querySelector( '.ast-mobile-popup-inner' ),
+ popupLinks = popupInner.getElementsByTagName('a');
+
+ for ( var item = 0; item < popupTriggerMobile.length; item++ ) {
+
+ popupTriggerMobile[item].removeEventListener("click", astraNavMenuToggle, false);
+ // Open the Popup when click on trigger
+ popupTriggerMobile[item].addEventListener("click", popupTriggerClick, false);
+ popupTriggerMobile[item].trigger_type = 'mobile';
+
+ }
+ for ( var item = 0; item < popupTriggerDesktop.length; item++ ) {
+
+ popupTriggerDesktop[item].removeEventListener("click", astraNavMenuToggle, false);
+ // Open the Popup when click on trigger
+ popupTriggerDesktop[item].addEventListener("click", popupTriggerClick, false);
+ popupTriggerDesktop[item].trigger_type = 'desktop';
+
+ }
+
+ //Close Popup on CLose Button Click.
+ popupClose.addEventListener("click", function( e ) {
+ document.getElementById( 'ast-mobile-popup' ).classList.remove( 'active', 'show' );
+ updateTrigger(this);
+ });
+
+ // Close Popup if esc is pressed.
+ document.addEventListener( 'keyup', function (event) {
+ // 27 is keymap for esc key.
+ if ( event.keyCode === 27 ) {
+ event.preventDefault();
+ document.getElementById( 'ast-mobile-popup' ).classList.remove( 'active', 'show' );
+ updateTrigger();
+ }
+ });
+
+ // Close Popup on outside click.
+ document.addEventListener('click', function (event) {
+
+ var target = event.target;
+ var modal = document.querySelector( '.ast-mobile-popup-drawer.active .ast-mobile-popup-overlay' );
+ if ( target === modal ) {
+ document.getElementById( 'ast-mobile-popup' ).classList.remove( 'active', 'show' );
+ updateTrigger();
+ }
+ });
+
+ // Close Popup on # link click inside Popup.
+ for ( link = 0, len = popupLinks.length; link < len; link++ ) {
+ if( null !== popupLinks[link].getAttribute("href") && '#' !== popupLinks[link].getAttribute("href") ){
+ popupLinks[link].addEventListener( 'click', triggerToggleClose, true );
+ popupLinks[link].headerType = 'off-canvas';
+ }
+ }
+
+ AstraToggleSetup();
+ } else if ( 'dropdown' === mobileHeaderType ) {
+
+ var mobileDropdownContent = document.querySelector( '.ast-mobile-header-content' ),
+ desktopDropdownContent = document.querySelector( '.ast-desktop-header-content' ),
+ mobileLinks = mobileDropdownContent.getElementsByTagName('a'),
+ desktopLinks = desktopDropdownContent.getElementsByTagName('a');
+
+ // Close Popup on # link click inside Popup.
+ for ( link = 0, len = mobileLinks.length; link < len; link++ ) {
+ if( null !== mobileLinks[link].getAttribute("href") && '#' !== mobileLinks[link].getAttribute("href") ){
+ mobileLinks[link].addEventListener( 'click', triggerToggleClose, true );
+ mobileLinks[link].headerType = 'dropdown';
+ }
+ }
+
+ // Close Popup on # link click inside Popup.
+ for ( link = 0, len = desktopLinks.length; link < len; link++ ) {
+ desktopLinks[link].addEventListener( 'click', triggerToggleClose, true );
+ desktopLinks[link].headerType = 'dropdown';
+ }
+
+ for ( var item = 0; item < popupTriggerMobile.length; item++ ) {
+
+ popupTriggerMobile[item].removeEventListener("click", popupTriggerClick, false);
+ popupTriggerMobile[item].addEventListener('click', astraNavMenuToggle, false);
+ popupTriggerMobile[item].trigger_type = 'mobile';
+
+ }
+ for ( var item = 0; item < popupTriggerDesktop.length; item++ ) {
+
+ popupTriggerDesktop[item].removeEventListener("click", popupTriggerClick, false);
+ popupTriggerDesktop[item].addEventListener('click', astraNavMenuToggle, false);
+ popupTriggerDesktop[item].trigger_type = 'desktop';
+
+ }
+
+ AstraToggleSetup();
+ }
+
+ accountPopupTrigger();
+
+ }
+
+ function triggerToggleClose( event ) {
+
+ var headerType = event.currentTarget.headerType;
+
+ switch( headerType ) {
+
+ case 'dropdown':
+
+ var popupTrigger = document.querySelectorAll( '.menu-toggle.toggled' );
+
+ for ( var item = 0; item < popupTrigger.length; item++ ) {
+
+ popupTrigger[item].click();
+ }
+ break;
+ case 'off-canvas':
+
+ var popupClose = document.getElementById( 'menu-toggle-close' );
+
+ popupClose.click();
+ break;
+ default:
+ break;
+ }
+ }
+
+ window.addEventListener( 'load', function() {
+ init();
+ } );
+ document.addEventListener( 'astLayoutWidthChanged', function() {
+ init();
+ } );
+
+ document.addEventListener( 'astPartialContentRendered', function() {
+
+ menu_toggle_all = document.querySelectorAll( '.main-header-menu-toggle' );
+
+ body.classList.remove("ast-main-header-nav-open");
+
+ document.addEventListener( 'astMobileHeaderTypeChange', updateHeaderType, false );
+
+ init();
+
+ accountPopupTrigger();
+
+ } );
+
+ var mobile_width = window.innerWidth;
+ function AstraHandleResizeEvent() {
+
+ var menu_offcanvas_close = document.getElementById('menu-toggle-close');
+ var menu_dropdown_close = document.querySelector('.menu-toggle.toggled');
+ var desktop_header_content = document.querySelector('#masthead > #ast-desktop-header .ast-desktop-header-content');
+ var elementor_editor = document.querySelector('.elementor-editor-active');
+
+ if ( desktop_header_content ) {
+ desktop_header_content.style.display = 'none';
+ }
+
+ if ( window.innerWidth !== mobile_width ) {
+ if ( menu_dropdown_close && null === elementor_editor ) {
+ menu_dropdown_close.click();
+ }
+ document.body.classList.remove( 'ast-main-header-nav-open', 'ast-popup-nav-open' );
+ }
+
+ if( menu_offcanvas_close && null === elementor_editor ) {
+ menu_offcanvas_close.click();
+ }
+ updateHeaderBreakPoint();
+
+ if ( 'dropdown' === mobileHeaderType ) {
+ AstraToggleSetup();
+ }
+ }
+
+ window.addEventListener('resize', function(){
+ // Skip resize event when keyboard display event triggers on devices.
+ if( 'INPUT' !== document.activeElement.tagName ) {
+ AstraHandleResizeEvent();
+ }
+ } );
+
+ document.addEventListener('DOMContentLoaded', function () {
+ AstraToggleSetup();
+ /**
+ * Navigation Keyboard Navigation.
+ */
+ var container, count;
+
+ container = document.querySelectorAll( '.navigation-accessibility' );
+
+ for ( count = 0; count <= container.length - 1; count++ ) {
+ if ( container[count] ) {
+ navigation_accessibility( container[count] );
+ }
+ }
+ });
+
+ var get_window_width = function () {
+
+ return document.documentElement.clientWidth;
+ }
+
+ /* Add break point Class and related trigger */
+ var updateHeaderBreakPoint = function () {
+
+ // Content overrflowing out of screen can give incorrect window.innerWidth.
+ // Adding overflow hidden and then calculating the window.innerWidth fixes the problem.
+ var originalOverflow = body.style.overflow;
+ body.style.overflow = 'hidden';
+ var ww = get_window_width();
+ body.style.overflow = originalOverflow;
+
+ var break_point = astra.break_point;
+
+ /**
+ * This case is when one hits a URL one after the other via `Open in New Tab` option
+ * Chrome returns the value of outer width as 0 in this case.
+ * This mis-calculates the width of the window and header seems invisible.
+ * This could be fixed by using `0 === ww` condition below.
+ */
+ if (ww > break_point || 0 === ww) {
+ //remove menu toggled class.
+ if ( menu_toggle_all.length > 0 ) {
+
+ for (var i = 0; i < menu_toggle_all.length; i++) {
+
+ if( null !== menu_toggle_all[i] ) {
+ menu_toggle_all[i].classList.remove('toggled');
+ }
+ }
+ }
+ body.classList.remove("ast-header-break-point");
+ body.classList.add("ast-desktop");
+ astraTriggerEvent(body, "astra-header-responsive-enabled");
+
+ } else {
+
+ body.classList.add("ast-header-break-point");
+ body.classList.remove("ast-desktop");
+ astraTriggerEvent(body, "astra-header-responsive-disabled")
+ }
+ }
+
+ var accountPopupTrigger = function () {
+ // Account login form popup.
+ var header_account_trigger = document.querySelectorAll( '.ast-account-action-login' )[0];
+
+ if( undefined !== header_account_trigger ) {
+
+ var header_account__close_trigger = document.getElementById( 'ast-hb-login-close' );
+ var login_popup = document.getElementById( 'ast-hb-account-login-wrap' );
+
+ header_account_trigger.onclick = function( event ) {
+ event.preventDefault();
+ event.stopPropagation();
+ if ( ! login_popup.classList.contains( 'show' ) ) {
+ login_popup.classList.add( 'show' );
+ }
+ };
+
+ header_account__close_trigger.onclick = function( event ) {
+ event.preventDefault();
+ login_popup.classList.remove( 'show' );
+ };
+ }
+ }
+
+ updateHeaderBreakPoint();
+
+ AstraToggleSubMenu = function( event ) {
+
+ event.preventDefault();
+
+ var parent_li = this.parentNode;
+
+ if ( parent_li.classList.contains('ast-submenu-expanded') && document.querySelector('header.site-header').classList.contains('ast-builder-menu-toggle-link') ) {
+
+ if (!this.classList.contains('ast-menu-toggle')) {
+
+ var link = parent_li.querySelector('a').getAttribute('href');
+ if ( '' !== link && '#' !== link) {
+ window.location = link;
+ }
+ }
+ }
+
+ var parent_li_child = parent_li.querySelectorAll('.menu-item-has-children');
+ for (var j = 0; j < parent_li_child.length; j++) {
+
+ parent_li_child[j].classList.remove('ast-submenu-expanded');
+ var parent_li_child_sub_menu = parent_li_child[j].querySelector('.sub-menu, .children');
+ if( null !== parent_li_child_sub_menu ) {
+ parent_li_child_sub_menu.style.display = 'none';
+ }
+ }
+
+ var parent_li_sibling = parent_li.parentNode.querySelectorAll('.menu-item-has-children');
+ for (var j = 0; j < parent_li_sibling.length; j++) {
+
+ if (parent_li_sibling[j] != parent_li) {
+
+ parent_li_sibling[j].classList.remove('ast-submenu-expanded');
+ var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu');
+ for (var k = 0; k < all_sub_menu.length; k++) {
+ all_sub_menu[k].style.display = 'none';
+ }
+ }
+ }
+
+ if (parent_li.classList.contains('menu-item-has-children') ) {
+ astraToggleClass(parent_li, 'ast-submenu-expanded');
+ if (parent_li.classList.contains('ast-submenu-expanded')) {
+ parent_li.querySelector('.sub-menu').style.display = 'block';
+ } else {
+ parent_li.querySelector('.sub-menu').style.display = 'none';
+ }
+ }
+ };
+
+ AstraNavigationMenu = function( parentList ) {
+ console.warn( 'AstraNavigationMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future.' );
+ };
+
+ AstraToggleMenu = function( astra_menu_toggle ) {
+ console.warn('AstraToggleMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future. Use AstraToggleSubMenu() instead.');
+
+ // Add Eventlisteners for Submenu.
+ if (astra_menu_toggle.length > 0) {
+ for (var i = 0; i < astra_menu_toggle.length; i++) {
+ astra_menu_toggle[i].addEventListener('click', AstraToggleSubMenu, false);
+ }
+ }
+ };
+
+ AstraToggleSetup = function () {
+
+ if ( 'off-canvas' === mobileHeaderType || 'full-width' === mobileHeaderType ) {
+ // comma separated selector added, if menu is outside of Off-Canvas then submenu is not clickable, it work only for Off-Canvas area with dropdown style.
+ var __main_header_all = document.querySelectorAll( '#ast-mobile-popup, #ast-mobile-header' );
+ if ( body.classList.contains('ast-header-break-point') ) {
+
+ var menu_toggle_all = document.querySelectorAll( '#ast-mobile-header .main-header-menu-toggle' );
+ } else {
+ menu_toggle_all = document.querySelectorAll( '#ast-desktop-header .main-header-menu-toggle' );
+ }
+ } else {
+
+ if ( body.classList.contains('ast-header-break-point') ) {
+
+ var __main_header_all = document.querySelectorAll( '#ast-mobile-header' ),
+ menu_toggle_all = document.querySelectorAll( '#ast-mobile-header .main-header-menu-toggle' );
+ } else {
+
+ var __main_header_all = document.querySelectorAll( '#ast-desktop-header' ),
+ menu_toggle_all = document.querySelectorAll( '#ast-desktop-header .main-header-menu-toggle' );
+ }
+ }
+
+ if (menu_toggle_all.length > 0) {
+
+ for (var i = 0; i < menu_toggle_all.length; i++) {
+
+ menu_toggle_all[i].setAttribute('data-index', i);
+
+ if ( ! menu_click_listeners[i] ) {
+ menu_click_listeners[i] = menu_toggle_all[i];
+ menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false);
+ }
+
+ if ('undefined' !== typeof __main_header_all[i]) {
+
+ // To handle the comma seprated selector added above we need this loop.
+ for( var mainHeaderCount =0; mainHeaderCount < __main_header_all.length; mainHeaderCount++ ){
+
+ if (document.querySelector('header.site-header').classList.contains('ast-builder-menu-toggle-link')) {
+ var astra_menu_toggle = __main_header_all[mainHeaderCount].querySelectorAll('ul.main-header-menu .menu-item-has-children > .menu-link, ul.main-header-menu .ast-menu-toggle');
+ } else {
+ var astra_menu_toggle = __main_header_all[mainHeaderCount].querySelectorAll('ul.main-header-menu .ast-menu-toggle');
+ }
+ // Add Eventlisteners for Submenu.
+ if (astra_menu_toggle.length > 0) {
+
+ for (var j = 0; j < astra_menu_toggle.length; j++) {
+
+ astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false);
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+ astraNavMenuToggle = function ( event ) {
+
+ event.preventDefault();
+
+ var desktop_header = event.target.closest('#ast-desktop-header');
+
+ var desktop_header_content = document.querySelector('#masthead > #ast-desktop-header .ast-desktop-header-content');
+
+ if ( null !== desktop_header && undefined !== desktop_header && '' !== desktop_header ) {
+
+ var desktop_toggle = desktop_header.querySelector( '.main-header-menu-toggle' );
+ } else {
+ var desktop_toggle = document.querySelector('#masthead > #ast-desktop-header .main-header-menu-toggle');
+ }
+
+ var desktop_menu = document.querySelector('#masthead > #ast-desktop-header .ast-desktop-header-content .main-header-bar-navigation');
+
+ if ( 'desktop' === event.currentTarget.trigger_type ) {
+
+ if ( null !== desktop_menu && '' !== desktop_menu && undefined !== desktop_menu ) {
+ astraToggleClass(desktop_menu, 'toggle-on');
+ if (desktop_menu.classList.contains('toggle-on')) {
+ desktop_menu.style.display = 'block';
+ } else {
+ desktop_menu.style.display = '';
+ }
+ }
+ astraToggleClass(desktop_toggle, 'toggled');
+ if ( desktop_toggle.classList.contains( 'toggled' ) ) {
+ body.classList.add("ast-main-header-nav-open");
+ if ( 'dropdown' === mobileHeaderType ) {
+ desktop_header_content.style.display = 'block';
+ }
+ } else {
+ body.classList.remove("ast-main-header-nav-open");
+ desktop_header_content.style.display = 'none';
+ }
+ return;
+ }
+
+ var __main_header_all = document.querySelectorAll('#masthead > #ast-mobile-header .main-header-bar-navigation');
+ menu_toggle_all = document.querySelectorAll( '#masthead > #ast-mobile-header .main-header-menu-toggle' )
+ var event_index = '0';
+ var sticky_header = false;
+ if ( null !== this.closest( '#ast-fixed-header' ) ) {
+
+ __main_header_all = document.querySelectorAll('#ast-fixed-header > #ast-mobile-header .main-header-bar-navigation');
+ menu_toggle_all = document.querySelectorAll( '#ast-fixed-header .main-header-menu-toggle' )
+
+ event_index = '0';
+ sticky_header = true;
+
+ }
+
+ if ('undefined' === typeof __main_header_all[event_index]) {
+ return false;
+ }
+ var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children');
+ for (var i = 0; i < menuHasChildren.length; i++) {
+ menuHasChildren[i].classList.remove('ast-submenu-expanded');
+ var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu');
+ for (var j = 0; j < menuHasChildrenSubMenu.length; j++) {
+ menuHasChildrenSubMenu[j].style.display = 'none';
+ }
+ }
+
+ var menu_class = this.getAttribute('class') || '';
+
+ if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) {
+ astraToggleClass(__main_header_all[event_index], 'toggle-on');
+ astraToggleClass(menu_toggle_all[event_index], 'toggled');
+ if ( sticky_header && 1 < menu_toggle_all.length ) {
+ astraToggleClass(menu_toggle_all['1'], 'toggled');
+ }
+ if (__main_header_all[event_index].classList.contains('toggle-on')) {
+ __main_header_all[event_index].style.display = 'block';
+ body.classList.add("ast-main-header-nav-open");
+ } else {
+ __main_header_all[event_index].style.display = '';
+ body.classList.remove("ast-main-header-nav-open");
+ }
+ }
+ };
+
+ body.addEventListener("astra-header-responsive-enabled", function () {
+
+ var __main_header_all = document.querySelectorAll('.main-header-bar-navigation');
+
+ if (__main_header_all.length > 0) {
+
+ for (var i = 0; i < __main_header_all.length; i++) {
+ if (null != __main_header_all[i]) {
+ __main_header_all[i].classList.remove('toggle-on');
+ __main_header_all[i].style.display = '';
+ }
+
+ var sub_menu = __main_header_all[i].getElementsByClassName('sub-menu');
+ for (var j = 0; j < sub_menu.length; j++) {
+ sub_menu[j].style.display = '';
+ }
+ var child_menu = __main_header_all[i].getElementsByClassName('children');
+ for (var k = 0; k < child_menu.length; k++) {
+ child_menu[k].style.display = '';
+ }
+
+ var searchIcons = __main_header_all[i].getElementsByClassName('ast-search-menu-icon');
+ for (var l = 0; l < searchIcons.length; l++) {
+ searchIcons[l].classList.remove('ast-dropdown-active');
+ searchIcons[l].style.display = '';
+ }
+ }
+ }
+ }, false);
+
+ var get_browser = function () {
+ var ua = navigator.userAgent,tem,M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
+ if(/trident/i.test(M[1])) {
+ tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
+ return;
+ }
+ if( 'Chrome' === M[1] ) {
+ tem = ua.match(/\bOPR|Edge\/(\d+)/)
+ if(tem != null) {
+ return;
+ }
+ }
+ M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
+ if((tem = ua.match(/version\/(\d+)/i)) != null) {
+ M.splice(1,1,tem[1]);
+ }
+
+ if( 'Safari' === M[0] && M[1] < 11 ) {
+ bodyElement.classList.add( "ast-safari-browser-less-than-11" );
+ }
+ }
+
+ get_browser();
+
+ /* Search Script */
+ var SearchIcons = document.getElementsByClassName( 'astra-search-icon' );
+ for (var i = 0; i < SearchIcons.length; i++) {
+
+ SearchIcons[i].onclick = function(event) {
+ if ( this.classList.contains( 'slide-search' ) ) {
+ event.preventDefault();
+ var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' );
+ if ( ! sibling.classList.contains( 'ast-dropdown-active' ) ) {
+ sibling.classList.add( 'ast-dropdown-active' );
+ sibling.querySelector( '.search-field' ).setAttribute('autocomplete','off');
+ setTimeout(function() {
+ sibling.querySelector( '.search-field' ).focus();
+ },200);
+ } else {
+ var searchTerm = sibling.querySelector( '.search-field' ).value || '';
+ if( '' !== searchTerm ) {
+ sibling.querySelector( '.search-form' ).submit();
+ }
+ sibling.classList.remove( 'ast-dropdown-active' );
+ }
+ }
+ }
+ }
+
+ /* Hide Dropdown on body click*/
+ body.onclick = function( event ) {
+ if ( typeof event.target.classList !== 'undefined' ) {
+ if ( ! event.target.classList.contains( 'ast-search-menu-icon' ) && astraGetParents( event.target, '.ast-search-menu-icon' ).length === 0 && astraGetParents( event.target, '.ast-search-icon' ).length === 0 ) {
+ var dropdownSearchWrap = document.getElementsByClassName( 'ast-search-menu-icon' );
+ for (var i = 0; i < dropdownSearchWrap.length; i++) {
+ dropdownSearchWrap[i].classList.remove( 'ast-dropdown-active' );
+ }
+ }
+ }
+ }
+
+ /**
+ * Navigation Keyboard Navigation.
+ */
+ function navigation_accessibility( container ) {
+ if ( ! container ) {
+ return;
+ }
+
+ var button = container.getElementsByTagName( 'button' )[0];
+ if ( 'undefined' === typeof button ) {
+ button = container.getElementsByTagName( 'a' )[0];
+ if ( 'undefined' === typeof button ) {
+ return;
+ }
+ }
+
+ var menu = container.getElementsByTagName( 'ul' )[0];
+
+ // Hide menu toggle button if menu is empty and return early.
+ if ( 'undefined' === typeof menu ) {
+ button.style.display = 'none';
+ return;
+ }
+
+ menu.setAttribute( 'aria-expanded', 'false' );
+ if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
+ menu.className += ' nav-menu';
+ }
+
+ button.onclick = function() {
+ if ( -1 !== container.className.indexOf( 'toggled' ) ) {
+ container.className = container.className.replace( ' toggled', '' );
+ button.setAttribute( 'aria-expanded', 'false' );
+ menu.setAttribute( 'aria-expanded', 'false' );
+ } else {
+ container.className += ' toggled';
+ button.setAttribute( 'aria-expanded', 'true' );
+ menu.setAttribute( 'aria-expanded', 'true' );
+ }
+ };
+
+ // Get all the link elements within the menu.
+ var links = menu.getElementsByTagName( 'a' );
+ var subMenus = menu.getElementsByTagName( 'ul' );
+
+
+ // Set menu items with submenus to aria-haspopup="true".
+ for ( var i = 0, len = subMenus.length; i < len; i++ ) {
+ subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' );
+ }
+
+ // Each time a menu link is focused or blurred, toggle focus.
+ for ( i = 0, len = links.length; i < len; i++ ) {
+ links[i].addEventListener( 'focus', toggleFocus, true );
+ links[i].addEventListener( 'blur', toggleFocus, true );
+ links[i].addEventListener( 'click', toggleClose, true );
+ }
+ }
+
+ /**
+ * Close the Toggle Menu on Click on hash (#) link.
+ *
+ * @since 1.3.2
+ * @return void
+ */
+ function toggleClose( )
+ {
+ var self = this || '',
+ hash = '#';
+
+ if( self && ! self.classList.contains('astra-search-icon') && null === self.closest('.ast-builder-menu') ) {
+ var link = new String( self );
+ if( link.indexOf( hash ) !== -1 ) {
+ var link_parent = self.parentNode;
+ if ( body.classList.contains('ast-header-break-point') ) {
+ if( ! ( document.querySelector('header.site-header').classList.contains('ast-builder-menu-toggle-link') && link_parent.classList.contains('menu-item-has-children') ) ) {
+ /* Close Builder Header Menu */
+ var builder_header_menu_toggle = document.querySelector( '.main-header-menu-toggle' );
+ builder_header_menu_toggle.classList.remove( 'toggled' );
+
+ var main_header_bar_navigation = document.querySelector( '.main-header-bar-navigation' );
+ main_header_bar_navigation.classList.remove( 'toggle-on' );
+
+ main_header_bar_navigation.style.display = 'none';
+
+ astraTriggerEvent( document.querySelector('body'), 'astraMenuHashLinkClicked' );
+ }
+
+ } else {
+ while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
+ // On li elements toggle the class .focus.
+ if ( 'li' === self.tagName.toLowerCase() ) {
+ if ( -1 !== self.className.indexOf( 'focus' ) ) {
+ self.className = self.className.replace( ' focus', '' );
+ }
+ }
+ self = self.parentElement;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Sets or removes .focus class on an element on focus.
+ */
+ function toggleFocus() {
+ var self = this;
+ // Move up through the ancestors of the current link until we hit .nav-menu.
+ while ( -1 === self.className.indexOf( 'navigation-accessibility' ) ) {
+ // On li elements toggle the class .focus.
+ if ( 'li' === self.tagName.toLowerCase() ) {
+ self.classList.toggle('focus');
+ }
+ self = self.parentElement;
+ }
+ }
+
+ /* Add class if mouse clicked and remove if tab pressed */
+ if ( 'querySelector' in document && 'addEventListener' in window ) {
+ body.addEventListener( 'mousedown', function() {
+ body.classList.add( 'ast-mouse-clicked' );
+ } );
+
+ body.addEventListener( 'keydown', function() {
+ body.classList.remove( 'ast-mouse-clicked' );
+ } );
+ }
+
+})();
diff --git a/assets/js/unminified/mobile-cart.js b/assets/js/unminified/mobile-cart.js
new file mode 100644
index 0000000..7a1ff65
--- /dev/null
+++ b/assets/js/unminified/mobile-cart.js
@@ -0,0 +1,152 @@
+/**
+ *
+ * Handle Mobile Cart events.
+ *
+ * @since 3.1.0
+ * @package Astra
+ */
+
+(function () {
+
+ var cart_flyout = document.getElementById('astra-mobile-cart-drawer'),
+ main_header_masthead = document.getElementById('masthead');
+
+ // Return if masthead not exixts.
+ if (!main_header_masthead) {
+ return;
+ }
+
+ var woo_data = '',
+ mobileHeader = main_header_masthead.querySelector("#ast-mobile-header"),
+ edd_data = '';
+
+ if (undefined !== cart_flyout && '' !== cart_flyout && null !== cart_flyout) {
+ woo_data = cart_flyout.querySelector('.widget_shopping_cart.woocommerce');
+ edd_data = cart_flyout.querySelector('.widget_edd_cart_widget');
+ }
+
+ /**
+ * Opens the Cart Flyout.
+ */
+ cartFlyoutOpen = function (event) {
+ event.preventDefault();
+ var current_cart = event.currentTarget.cart_type;
+
+ if ('woocommerce' === current_cart && document.body.classList.contains('woocommerce-cart')) {
+ return;
+ }
+ cart_flyout.classList.remove('active');
+ cart_flyout.classList.remove('woocommerce-active');
+ cart_flyout.classList.remove('edd-active');
+ if (undefined !== cart_flyout && '' !== cart_flyout && null !== cart_flyout) {
+ cart_flyout.classList.add('active');
+ document.documentElement.classList.add('ast-mobile-cart-active');
+ if (undefined !== edd_data && '' !== edd_data && null !== edd_data) {
+ edd_data.style.display = 'block';
+ if ('woocommerce' === current_cart) {
+ edd_data.style.display = 'none';
+ cart_flyout.classList.add('woocommerce-active');
+ }
+ }
+ if (undefined !== woo_data && '' !== woo_data && null !== woo_data) {
+ woo_data.style.display = 'block';
+ if ('edd' === current_cart) {
+ woo_data.style.display = 'none';
+ cart_flyout.classList.add('edd-active');
+ }
+ }
+ }
+ }
+
+ /**
+ * Closes the Cart Flyout.
+ */
+ cartFlyoutClose = function (event) {
+ event.preventDefault();
+ if (undefined !== cart_flyout && '' !== cart_flyout && null !== cart_flyout) {
+ cart_flyout.classList.remove('active');
+ document.documentElement.classList.remove('ast-mobile-cart-active');
+ }
+ }
+
+ /**
+ * Main Init Function.
+ */
+ function cartInit() {
+ // Close Popup if esc is pressed.
+ document.addEventListener('keyup', function (event) {
+ // 27 is keymap for esc key.
+ if (event.keyCode === 27) {
+ event.preventDefault();
+ cart_flyout.classList.remove('active');
+ document.documentElement.classList.remove('ast-mobile-cart-active');
+ updateTrigger();
+ }
+ });
+
+ // Close Popup on outside click.
+ document.addEventListener('click', function (event) {
+ var target = event.target;
+ var cart_modal = document.querySelector('.ast-mobile-cart-active .astra-mobile-cart-overlay');
+
+ if (target === cart_modal) {
+ cart_flyout.classList.remove('active');
+ document.documentElement.classList.remove('ast-mobile-cart-active');
+ }
+ });
+
+ if (undefined !== mobileHeader && '' !== mobileHeader && null !== mobileHeader) {
+
+ // Mobile Header Cart Flyout.
+ var woo_carts = document.querySelectorAll('.ast-mobile-header-wrap .ast-header-woo-cart');
+ var edd_cart = document.querySelector('.ast-mobile-header-wrap .ast-header-edd-cart');
+ var cart_close = document.querySelector('.astra-cart-drawer-close');
+
+ if( 0 < woo_carts.length ){
+ woo_carts.forEach(function callbackFn(woo_cart) {
+ if (undefined !== woo_cart && '' !== woo_cart && null !== woo_cart) {
+ woo_cart.addEventListener("click", cartFlyoutOpen, false);
+ woo_cart.cart_type = 'woocommerce';
+ }
+ })
+ }
+ if (undefined !== edd_cart && '' !== edd_cart && null !== edd_cart) {
+ edd_cart.addEventListener("click", cartFlyoutOpen, false);
+ edd_cart.cart_type = 'edd';
+ }
+ if (undefined !== cart_close && '' !== cart_close && null !== cart_close) {
+ cart_close.addEventListener("click", cartFlyoutClose, false);
+ }
+ }
+
+ }
+
+ window.addEventListener('resize', function () {
+ // Close Cart
+ var cart_close = document.querySelector('.astra-cart-drawer-close');
+ if (undefined !== cart_close && '' !== cart_close && null !== cart_close && 'INPUT' !== document.activeElement.tagName ) {
+ cart_close.click();
+ }
+ });
+
+ window.addEventListener('load', function () {
+ cartInit();
+ });
+ document.addEventListener('astLayoutWidthChanged', function () {
+ cartInit();
+ });
+
+ document.addEventListener('astPartialContentRendered', function () {
+ cartInit();
+ });
+
+ var layoutChangeDelay;
+ window.addEventListener('resize', function () {
+ clearTimeout(layoutChangeDelay);
+ layoutChangeDelay = setTimeout(function () {
+ cartInit();
+ document.dispatchEvent(new CustomEvent("astLayoutWidthChanged", {"detail": {'response': ''}}));
+ }, 50);
+ });
+
+})();
diff --git a/assets/js/unminified/navigation.js b/assets/js/unminified/navigation.js
new file mode 100644
index 0000000..8504f19
--- /dev/null
+++ b/assets/js/unminified/navigation.js
@@ -0,0 +1,595 @@
+/**
+ * File navigation.js
+ *
+ * Handles toggling the navigation menu for small screens and enables tab
+ * support for dropdown menus.
+ *
+ * @package Astra
+ */
+
+/**
+ * Get all of an element's parent elements up the DOM tree
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var astraGetParents = function ( elem, selector ) {
+
+ // Element.matches() polyfill.
+ if ( ! Element.prototype.matches) {
+ Element.prototype.matches =
+ Element.prototype.matchesSelector ||
+ Element.prototype.mozMatchesSelector ||
+ Element.prototype.msMatchesSelector ||
+ Element.prototype.oMatchesSelector ||
+ Element.prototype.webkitMatchesSelector ||
+ function(s) {
+ var matches = (this.document || this.ownerDocument).querySelectorAll( s ),
+ i = matches.length;
+ while (--i >= 0 && matches.item( i ) !== this) {}
+ return i > -1;
+ };
+ }
+
+ // Setup parents array.
+ var parents = [];
+
+ // Get matching parent elements.
+ for ( ; elem && elem !== document; elem = elem.parentNode ) {
+
+ // Add matching parents to array.
+ if ( selector ) {
+ if ( elem.matches( selector ) ) {
+ parents.push( elem );
+ }
+ } else {
+ parents.push( elem );
+ }
+ }
+ return parents;
+};
+
+/**
+ * Deprecated: Get all of an element's parent elements up the DOM tree
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var getParents = function ( elem, selector ) {
+ console.warn( 'getParents() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraGetParents() instead.' );
+ astraGetParents( elem, selector );
+}
+
+/**
+ * Toggle Class funtion
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var astraToggleClass = function ( el, className ) {
+ if ( el.classList.contains( className ) ) {
+ el.classList.remove( className );
+ } else {
+ el.classList.add( className );
+ }
+};
+
+/**
+ * Deprecated: Toggle Class funtion
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var toggleClass = function ( el, className ) {
+ console.warn( 'toggleClass() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraToggleClass() instead.' );
+ astraToggleClass( el, className );
+};
+
+// CustomEvent() constructor functionality in Internet Explorer 9 and higher.
+(function () {
+
+ if (typeof window.CustomEvent === "function") return false;
+ function CustomEvent(event, params) {
+ params = params || { bubbles: false, cancelable: false, detail: undefined };
+ var evt = document.createEvent('CustomEvent');
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
+ return evt;
+ }
+ CustomEvent.prototype = window.Event.prototype;
+ window.CustomEvent = CustomEvent;
+})();
+
+/**
+ * Trigget custom JS Event.
+ *
+ * @since 1.4.6
+ *
+ * @link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent
+ * @param {Node} el Dom Node element on which the event is to be triggered.
+ * @param {Node} typeArg A DOMString representing the name of the event.
+ * @param {String} A CustomEventInit dictionary, having the following fields:
+ * "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event.
+ */
+var astraTriggerEvent = function astraTriggerEvent( el, typeArg ) {
+ var customEventInit =
+ arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+
+ var event = new CustomEvent(typeArg, customEventInit);
+ el.dispatchEvent(event);
+};
+
+( function() {
+
+ var menu_toggle_all = document.querySelectorAll( '.main-header-menu-toggle' );
+ var menu_click_listeners = {};
+
+ /* Add break point Class and related trigger */
+ var updateHeaderBreakPoint = function () {
+
+ // Content overrflowing out of screen can give incorrect window.innerWidth.
+ // Adding overflow hidden and then calculating the window.innerWidth fixes the problem.
+ var originalOverflow = document.querySelector('body').style.overflow;
+ document.querySelector('body').style.overflow = 'hidden';
+ var ww = window.innerWidth;
+ document.querySelector('body').style.overflow = originalOverflow;
+
+ var break_point = astra.break_point,
+ headerWrap = document.querySelectorAll('.main-header-bar-wrap');
+
+ if (headerWrap.length > 0) {
+ for (var i = 0; i < headerWrap.length; i++) {
+
+ if (headerWrap[i].tagName == 'DIV' && headerWrap[i].classList.contains('main-header-bar-wrap')) {
+ if (ww > break_point) {
+ //remove menu toggled class.
+ if (null != menu_toggle_all[i]) {
+ menu_toggle_all[i].classList.remove('toggled');
+ }
+ document.body.classList.remove("ast-header-break-point");
+ document.body.classList.add("ast-desktop");
+ astraTriggerEvent(document.body, "astra-header-responsive-enabled");
+
+ } else {
+
+ document.body.classList.add("ast-header-break-point");
+ document.body.classList.remove("ast-desktop");
+ astraTriggerEvent(document.body, "astra-header-responsive-disabled")
+ }
+ }
+ }
+ }
+ }
+
+ updateHeaderBreakPoint();
+
+ AstraToggleSubMenu = function() {
+ var parent_li = this.parentNode;
+ if (parent_li.classList.contains('ast-submenu-expanded') && document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) {
+ if (!this.classList.contains('ast-menu-toggle')) {
+ var link = parent_li.querySelector('a').getAttribute('href');
+ if ('' !== link || '#' !== link) {
+ window.location = link;
+ }
+ }
+ }
+
+ var parent_li_child = parent_li.querySelectorAll('.menu-item-has-children');
+ for (var j = 0; j < parent_li_child.length; j++) {
+
+ parent_li_child[j].classList.remove('ast-submenu-expanded');
+ var parent_li_child_sub_menu = parent_li_child[j].querySelector('.sub-menu, .children');
+ if( null !== parent_li_child_sub_menu ) {
+ parent_li_child_sub_menu.style.display = 'none';
+ }
+ }
+
+ var parent_li_sibling = parent_li.parentNode.querySelectorAll('.menu-item-has-children');
+ for (var j = 0; j < parent_li_sibling.length; j++) {
+
+ if (parent_li_sibling[j] != parent_li) {
+
+ parent_li_sibling[j].classList.remove('ast-submenu-expanded');
+ var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu');
+ for (var k = 0; k < all_sub_menu.length; k++) {
+ all_sub_menu[k].style.display = 'none';
+ }
+ }
+ }
+
+ if (parent_li.classList.contains('menu-item-has-children') ) {
+ astraToggleClass(parent_li, 'ast-submenu-expanded');
+ if (parent_li.classList.contains('ast-submenu-expanded')) {
+ parent_li.querySelector('.sub-menu').style.display = 'block';
+ } else {
+ parent_li.querySelector('.sub-menu').style.display = 'none';
+ }
+ }
+ };
+
+ AstraNavigationMenu = function( parentList ) {
+ console.warn( 'AstraNavigationMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future.' );
+ };
+
+ AstraToggleMenu = function( astra_menu_toggle ) {
+ console.warn('AstraToggleMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future. Use AstraToggleSubMenu() instead.');
+
+ // Add Eventlisteners for Submenu.
+ if (astra_menu_toggle.length > 0) {
+ for (var i = 0; i < astra_menu_toggle.length; i++) {
+ astra_menu_toggle[i].addEventListener('click', AstraToggleSubMenu, false);
+ }
+ }
+ };
+
+ AstraToggleSetup = function () {
+ var __main_header_all = document.querySelectorAll('.main-header-bar-navigation');
+
+ if (menu_toggle_all.length > 0) {
+
+ for (var i = 0; i < menu_toggle_all.length; i++) {
+
+ menu_toggle_all[i].setAttribute('data-index', i);
+
+ if ( ! menu_click_listeners[i] ) {
+ menu_click_listeners[i] = menu_toggle_all[i];
+ menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false);
+ }
+
+ if ('undefined' !== typeof __main_header_all[i]) {
+
+ if (document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) {
+ var astra_menu_toggle = __main_header_all[i].querySelectorAll('.ast-header-break-point .main-header-menu .menu-item-has-children > .menu-link, .ast-header-break-point ul.main-header-menu .ast-menu-toggle');
+ } else {
+ var astra_menu_toggle = __main_header_all[i].querySelectorAll('ul.main-header-menu .ast-menu-toggle');
+ }
+
+ // Add Eventlisteners for Submenu.
+ if (astra_menu_toggle.length > 0) {
+ for (var j = 0; j < astra_menu_toggle.length; j++) {
+ astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false);
+ }
+ }
+
+ }
+ }
+ }
+ };
+
+ astraNavMenuToggle = function ( event ) {
+ event.preventDefault();
+ var __main_header_all = document.querySelectorAll('.main-header-bar-navigation');
+ var event_index = this.getAttribute('data-index');
+
+ if ('undefined' === typeof __main_header_all[event_index]) {
+ return false;
+ }
+
+ var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children');
+ for (var i = 0; i < menuHasChildren.length; i++) {
+ menuHasChildren[i].classList.remove('ast-submenu-expanded');
+ var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu');
+ for (var j = 0; j < menuHasChildrenSubMenu.length; j++) {
+ menuHasChildrenSubMenu[j].style.display = 'none';
+ }
+ }
+
+ var menu_class = this.getAttribute('class') || '';
+
+ if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) {
+ astraToggleClass(__main_header_all[event_index], 'toggle-on');
+ astraToggleClass(menu_toggle_all[event_index], 'toggled');
+ if (__main_header_all[event_index].classList.contains('toggle-on')) {
+ __main_header_all[event_index].style.display = 'block';
+ document.body.classList.add("ast-main-header-nav-open");
+ } else {
+ __main_header_all[event_index].style.display = '';
+ document.body.classList.remove("ast-main-header-nav-open");
+ }
+ }
+ };
+
+ document.body.addEventListener("astra-header-responsive-enabled", function () {
+
+ var __main_header_all = document.querySelectorAll('.main-header-bar-navigation');
+
+ if (__main_header_all.length > 0) {
+
+ for (var i = 0; i < __main_header_all.length; i++) {
+ if (null != __main_header_all[i]) {
+ __main_header_all[i].classList.remove('toggle-on');
+ __main_header_all[i].style.display = '';
+ }
+
+ var sub_menu = __main_header_all[i].getElementsByClassName('sub-menu');
+ for (var j = 0; j < sub_menu.length; j++) {
+ sub_menu[j].style.display = '';
+ }
+ var child_menu = __main_header_all[i].getElementsByClassName('children');
+ for (var k = 0; k < child_menu.length; k++) {
+ child_menu[k].style.display = '';
+ }
+
+ var searchIcons = __main_header_all[i].getElementsByClassName('ast-search-menu-icon');
+ for (var l = 0; l < searchIcons.length; l++) {
+ searchIcons[l].classList.remove('ast-dropdown-active');
+ searchIcons[l].style.display = '';
+ }
+ }
+ }
+ }, false);
+
+ window.addEventListener('resize', function () {
+ // Skip resize event when keyboard display event triggers on devices.
+ if( 'INPUT' !== document.activeElement.tagName ) {
+ updateHeaderBreakPoint();
+ AstraToggleSetup();
+ }
+ });
+
+ document.addEventListener('DOMContentLoaded', function () {
+ AstraToggleSetup();
+ /**
+ * Navigation Keyboard Navigation.
+ */
+ var container, count;
+
+ container = document.querySelectorAll( '.navigation-accessibility' );
+
+ for ( count = 0; count <= container.length - 1; count++ ) {
+ if ( container[count] ) {
+ navigation_accessibility( container[count] );
+ }
+ }
+ });
+
+
+ var get_browser = function () {
+ var ua = navigator.userAgent,tem,M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
+ if(/trident/i.test(M[1])) {
+ tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
+ return;
+ }
+ if( 'Chrome' === M[1] ) {
+ tem = ua.match(/\bOPR|Edge\/(\d+)/)
+ if(tem != null) {
+ return;
+ }
+ }
+ M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
+ if((tem = ua.match(/version\/(\d+)/i)) != null) {
+ M.splice(1,1,tem[1]);
+ }
+
+ var bodyElement = document.body;
+ if( 'Safari' === M[0] && M[1] < 11 ) {
+ bodyElement.classList.add( "ast-safari-browser-less-than-11" );
+ }
+ }
+
+ get_browser();
+
+ /* Search Script */
+ var SearchIcons = document.getElementsByClassName( 'astra-search-icon' );
+ for (var i = 0; i < SearchIcons.length; i++) {
+
+ SearchIcons[i].onclick = function(event) {
+ if ( this.classList.contains( 'slide-search' ) ) {
+ event.preventDefault();
+ var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' );
+ if ( ! sibling.classList.contains( 'ast-dropdown-active' ) ) {
+ sibling.classList.add( 'ast-dropdown-active' );
+ sibling.querySelector( '.search-field' ).setAttribute('autocomplete','off');
+ setTimeout(function() {
+ sibling.querySelector( '.search-field' ).focus();
+ },200);
+ } else {
+ var searchTerm = sibling.querySelector( '.search-field' ).value || '';
+ if( '' !== searchTerm ) {
+ sibling.querySelector( '.search-form' ).submit();
+ }
+ sibling.classList.remove( 'ast-dropdown-active' );
+ }
+ }
+ }
+ }
+
+ /* Hide Dropdown on body click*/
+ document.body.onclick = function( event ) {
+ if ( typeof event.target.classList !== 'undefined' ) {
+ if ( ! event.target.classList.contains( 'ast-search-menu-icon' ) && astraGetParents( event.target, '.ast-search-menu-icon' ).length === 0 && astraGetParents( event.target, '.ast-search-icon' ).length === 0 ) {
+ var dropdownSearchWrap = document.getElementsByClassName( 'ast-search-menu-icon' );
+ for (var i = 0; i < dropdownSearchWrap.length; i++) {
+ dropdownSearchWrap[i].classList.remove( 'ast-dropdown-active' );
+ }
+ }
+ }
+ }
+
+ /**
+ * Navigation Keyboard Navigation.
+ */
+ function navigation_accessibility( container ) {
+ if ( ! container ) {
+ return;
+ }
+
+ var button = container.getElementsByTagName( 'button' )[0];
+ if ( 'undefined' === typeof button ) {
+ button = container.getElementsByTagName( 'a' )[0];
+ if ( 'undefined' === typeof button ) {
+ return;
+ }
+ }
+
+ var menu = container.getElementsByTagName( 'ul' )[0];
+
+ // Hide menu toggle button if menu is empty and return early.
+ if ( 'undefined' === typeof menu ) {
+ button.style.display = 'none';
+ return;
+ }
+
+ menu.setAttribute( 'aria-expanded', 'false' );
+ if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
+ menu.className += ' nav-menu';
+ }
+
+ button.onclick = function() {
+ if ( -1 !== container.className.indexOf( 'toggled' ) ) {
+ container.className = container.className.replace( ' toggled', '' );
+ button.setAttribute( 'aria-expanded', 'false' );
+ menu.setAttribute( 'aria-expanded', 'false' );
+ } else {
+ container.className += ' toggled';
+ button.setAttribute( 'aria-expanded', 'true' );
+ menu.setAttribute( 'aria-expanded', 'true' );
+ }
+ };
+
+ // Get all the link elements within the menu.
+ var links = menu.getElementsByTagName( 'a' );
+ var subMenus = menu.getElementsByTagName( 'ul' );
+
+
+ // Set menu items with submenus to aria-haspopup="true".
+ for ( var i = 0, len = subMenus.length; i < len; i++ ) {
+ subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' );
+ }
+
+ // Each time a menu link is focused or blurred, toggle focus.
+ for ( i = 0, len = links.length; i < len; i++ ) {
+ links[i].addEventListener( 'focus', toggleFocus, true );
+ links[i].addEventListener( 'blur', toggleBlurFocus, true );
+ links[i].addEventListener( 'click', toggleClose, true );
+ }
+ }
+
+ /**
+ * Close the Toggle Menu on Click on hash (#) link.
+ *
+ * @since 1.3.2
+ * @return void
+ */
+ function toggleClose( )
+ {
+ var self = this || '',
+ hash = '#';
+
+ if( self && ! self.classList.contains('astra-search-icon') ) {
+ var link = new String( self );
+ if( link.indexOf( hash ) !== -1 ) {
+ var link_parent = self.parentNode;
+ if ( document.body.classList.contains('ast-header-break-point') && ! ( document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link") && link_parent.classList.contains("menu-item-has-children") ) ) {
+
+ /* Close Main Header Menu */
+ var main_header_menu_toggle = document.querySelector( '.main-header-menu-toggle' );
+ main_header_menu_toggle.classList.remove( 'toggled' );
+
+ var main_header_bar_navigation = document.querySelector( '.main-header-bar-navigation' );
+ main_header_bar_navigation.classList.remove( 'toggle-on' );
+
+ main_header_bar_navigation.style.display = 'none';
+
+ /* Close Below Header Menu */
+ var before_header_menu_toggle = document.querySelector( '.menu-below-header-toggle' );
+ var before_header_bar_navigation = document.querySelector( '.ast-below-header' );
+ var before_header_bar = document.querySelector( '.ast-below-header-actual-nav' );
+
+ if ( before_header_menu_toggle && before_header_bar_navigation && before_header_bar ) {
+ before_header_menu_toggle.classList.remove( 'toggled' );
+ before_header_bar_navigation.classList.remove( 'toggle-on' );
+ before_header_bar.style.display = 'none';
+ }
+
+ /* Close After Header Menu */
+ var after_header_menu_toggle = document.querySelector( '.menu-above-header-toggle' );
+ var after_header_bar_navigation = document.querySelector( '.ast-above-header' );
+ var after_header_bar = document.querySelector( '.ast-above-header-navigation' );
+
+ if ( after_header_menu_toggle && after_header_bar_navigation && after_header_bar ) {
+ after_header_menu_toggle.classList.remove( 'toggled' );
+ after_header_bar_navigation.classList.remove( 'toggle-on' );
+ after_header_bar.style.display = 'none';
+ }
+
+ astraTriggerEvent( document.querySelector('body'), 'astraMenuHashLinkClicked' );
+ } else {
+ while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
+ // On li elements toggle the class .focus.
+ if ( 'li' === self.tagName.toLowerCase() ) {
+ if ( -1 !== self.className.indexOf( 'focus' ) ) {
+ self.className = self.className.replace( ' focus', '' );
+ }
+ }
+ self = self.parentElement;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Sets or removes .focus class on an element on focus.
+ */
+ function toggleFocus() {
+ var self = this;
+ // Move up through the ancestors of the current link until we hit .nav-menu.
+ while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
+
+ // On li elements toggle the class .focus.
+ if ( 'li' === self.tagName.toLowerCase() ) {
+ if ( -1 !== self.className.indexOf( 'focus' ) ) {
+ self.className = self.className.replace( ' focus', '' );
+ } else {
+ self.className += ' focus';
+ }
+ }
+
+ self = self.parentElement;
+ }
+ }
+
+ /**
+ * Sets or removes .focus class on an element on blur.
+ */
+ function toggleBlurFocus() {
+ var self = this || '',
+ hash = '#';
+ var link = new String( self );
+ if( link.indexOf( hash ) !== -1 && document.body.classList.contains('ast-mouse-clicked') ) {
+ return;
+ }
+ // Move up through the ancestors of the current link until we hit .nav-menu.
+ while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
+
+ // On li elements toggle the class .focus.
+ if ( 'li' === self.tagName.toLowerCase() ) {
+ if ( -1 !== self.className.indexOf( 'focus' ) ) {
+ self.className = self.className.replace( ' focus', '' );
+ } else {
+ self.className += ' focus';
+ }
+ }
+
+ self = self.parentElement;
+ }
+ }
+
+ /* Add class if mouse clicked and remove if tab pressed */
+ if ( 'querySelector' in document && 'addEventListener' in window ) {
+ var body = document.body;
+
+ body.addEventListener( 'mousedown', function() {
+ body.classList.add( 'ast-mouse-clicked' );
+ } );
+
+ body.addEventListener( 'keydown', function() {
+ body.classList.remove( 'ast-mouse-clicked' );
+ } );
+ }
+
+} )();
diff --git a/assets/js/unminified/skip-link-focus-fix.js b/assets/js/unminified/skip-link-focus-fix.js
new file mode 100644
index 0000000..97496af
--- /dev/null
+++ b/assets/js/unminified/skip-link-focus-fix.js
@@ -0,0 +1,37 @@
+/**
+ * File skip-link-focus-fix.js
+ *
+ * Helps with accessibility for keyboard only users.
+ * This is the source file for what is minified in the astra_skip_link_focus_fix() PHP function.
+ *
+ * Learn more: https://github.com/Automattic/_s/pull/136
+ *
+ * @package Astra
+ */
+
+( function() {
+ var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
+ is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1,
+ is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1;
+
+ if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {
+ window.addEventListener( 'hashchange', function() {
+ var id = location.hash.substring( 1 ),
+ element;
+
+ if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
+ return;
+ }
+
+ element = document.getElementById( id );
+
+ if ( element ) {
+ if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
+ element.tabIndex = -1;
+ }
+
+ element.focus();
+ }
+ }, false );
+ }
+})();
diff --git a/assets/js/unminified/style.js b/assets/js/unminified/style.js
new file mode 100644
index 0000000..8504f19
--- /dev/null
+++ b/assets/js/unminified/style.js
@@ -0,0 +1,595 @@
+/**
+ * File navigation.js
+ *
+ * Handles toggling the navigation menu for small screens and enables tab
+ * support for dropdown menus.
+ *
+ * @package Astra
+ */
+
+/**
+ * Get all of an element's parent elements up the DOM tree
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var astraGetParents = function ( elem, selector ) {
+
+ // Element.matches() polyfill.
+ if ( ! Element.prototype.matches) {
+ Element.prototype.matches =
+ Element.prototype.matchesSelector ||
+ Element.prototype.mozMatchesSelector ||
+ Element.prototype.msMatchesSelector ||
+ Element.prototype.oMatchesSelector ||
+ Element.prototype.webkitMatchesSelector ||
+ function(s) {
+ var matches = (this.document || this.ownerDocument).querySelectorAll( s ),
+ i = matches.length;
+ while (--i >= 0 && matches.item( i ) !== this) {}
+ return i > -1;
+ };
+ }
+
+ // Setup parents array.
+ var parents = [];
+
+ // Get matching parent elements.
+ for ( ; elem && elem !== document; elem = elem.parentNode ) {
+
+ // Add matching parents to array.
+ if ( selector ) {
+ if ( elem.matches( selector ) ) {
+ parents.push( elem );
+ }
+ } else {
+ parents.push( elem );
+ }
+ }
+ return parents;
+};
+
+/**
+ * Deprecated: Get all of an element's parent elements up the DOM tree
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var getParents = function ( elem, selector ) {
+ console.warn( 'getParents() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraGetParents() instead.' );
+ astraGetParents( elem, selector );
+}
+
+/**
+ * Toggle Class funtion
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var astraToggleClass = function ( el, className ) {
+ if ( el.classList.contains( className ) ) {
+ el.classList.remove( className );
+ } else {
+ el.classList.add( className );
+ }
+};
+
+/**
+ * Deprecated: Toggle Class funtion
+ *
+ * @param {Node} elem The element.
+ * @param {String} selector Selector to match against [optional].
+ * @return {Array} The parent elements.
+ */
+var toggleClass = function ( el, className ) {
+ console.warn( 'toggleClass() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraToggleClass() instead.' );
+ astraToggleClass( el, className );
+};
+
+// CustomEvent() constructor functionality in Internet Explorer 9 and higher.
+(function () {
+
+ if (typeof window.CustomEvent === "function") return false;
+ function CustomEvent(event, params) {
+ params = params || { bubbles: false, cancelable: false, detail: undefined };
+ var evt = document.createEvent('CustomEvent');
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
+ return evt;
+ }
+ CustomEvent.prototype = window.Event.prototype;
+ window.CustomEvent = CustomEvent;
+})();
+
+/**
+ * Trigget custom JS Event.
+ *
+ * @since 1.4.6
+ *
+ * @link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent
+ * @param {Node} el Dom Node element on which the event is to be triggered.
+ * @param {Node} typeArg A DOMString representing the name of the event.
+ * @param {String} A CustomEventInit dictionary, having the following fields:
+ * "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event.
+ */
+var astraTriggerEvent = function astraTriggerEvent( el, typeArg ) {
+ var customEventInit =
+ arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+
+ var event = new CustomEvent(typeArg, customEventInit);
+ el.dispatchEvent(event);
+};
+
+( function() {
+
+ var menu_toggle_all = document.querySelectorAll( '.main-header-menu-toggle' );
+ var menu_click_listeners = {};
+
+ /* Add break point Class and related trigger */
+ var updateHeaderBreakPoint = function () {
+
+ // Content overrflowing out of screen can give incorrect window.innerWidth.
+ // Adding overflow hidden and then calculating the window.innerWidth fixes the problem.
+ var originalOverflow = document.querySelector('body').style.overflow;
+ document.querySelector('body').style.overflow = 'hidden';
+ var ww = window.innerWidth;
+ document.querySelector('body').style.overflow = originalOverflow;
+
+ var break_point = astra.break_point,
+ headerWrap = document.querySelectorAll('.main-header-bar-wrap');
+
+ if (headerWrap.length > 0) {
+ for (var i = 0; i < headerWrap.length; i++) {
+
+ if (headerWrap[i].tagName == 'DIV' && headerWrap[i].classList.contains('main-header-bar-wrap')) {
+ if (ww > break_point) {
+ //remove menu toggled class.
+ if (null != menu_toggle_all[i]) {
+ menu_toggle_all[i].classList.remove('toggled');
+ }
+ document.body.classList.remove("ast-header-break-point");
+ document.body.classList.add("ast-desktop");
+ astraTriggerEvent(document.body, "astra-header-responsive-enabled");
+
+ } else {
+
+ document.body.classList.add("ast-header-break-point");
+ document.body.classList.remove("ast-desktop");
+ astraTriggerEvent(document.body, "astra-header-responsive-disabled")
+ }
+ }
+ }
+ }
+ }
+
+ updateHeaderBreakPoint();
+
+ AstraToggleSubMenu = function() {
+ var parent_li = this.parentNode;
+ if (parent_li.classList.contains('ast-submenu-expanded') && document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) {
+ if (!this.classList.contains('ast-menu-toggle')) {
+ var link = parent_li.querySelector('a').getAttribute('href');
+ if ('' !== link || '#' !== link) {
+ window.location = link;
+ }
+ }
+ }
+
+ var parent_li_child = parent_li.querySelectorAll('.menu-item-has-children');
+ for (var j = 0; j < parent_li_child.length; j++) {
+
+ parent_li_child[j].classList.remove('ast-submenu-expanded');
+ var parent_li_child_sub_menu = parent_li_child[j].querySelector('.sub-menu, .children');
+ if( null !== parent_li_child_sub_menu ) {
+ parent_li_child_sub_menu.style.display = 'none';
+ }
+ }
+
+ var parent_li_sibling = parent_li.parentNode.querySelectorAll('.menu-item-has-children');
+ for (var j = 0; j < parent_li_sibling.length; j++) {
+
+ if (parent_li_sibling[j] != parent_li) {
+
+ parent_li_sibling[j].classList.remove('ast-submenu-expanded');
+ var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu');
+ for (var k = 0; k < all_sub_menu.length; k++) {
+ all_sub_menu[k].style.display = 'none';
+ }
+ }
+ }
+
+ if (parent_li.classList.contains('menu-item-has-children') ) {
+ astraToggleClass(parent_li, 'ast-submenu-expanded');
+ if (parent_li.classList.contains('ast-submenu-expanded')) {
+ parent_li.querySelector('.sub-menu').style.display = 'block';
+ } else {
+ parent_li.querySelector('.sub-menu').style.display = 'none';
+ }
+ }
+ };
+
+ AstraNavigationMenu = function( parentList ) {
+ console.warn( 'AstraNavigationMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future.' );
+ };
+
+ AstraToggleMenu = function( astra_menu_toggle ) {
+ console.warn('AstraToggleMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future. Use AstraToggleSubMenu() instead.');
+
+ // Add Eventlisteners for Submenu.
+ if (astra_menu_toggle.length > 0) {
+ for (var i = 0; i < astra_menu_toggle.length; i++) {
+ astra_menu_toggle[i].addEventListener('click', AstraToggleSubMenu, false);
+ }
+ }
+ };
+
+ AstraToggleSetup = function () {
+ var __main_header_all = document.querySelectorAll('.main-header-bar-navigation');
+
+ if (menu_toggle_all.length > 0) {
+
+ for (var i = 0; i < menu_toggle_all.length; i++) {
+
+ menu_toggle_all[i].setAttribute('data-index', i);
+
+ if ( ! menu_click_listeners[i] ) {
+ menu_click_listeners[i] = menu_toggle_all[i];
+ menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false);
+ }
+
+ if ('undefined' !== typeof __main_header_all[i]) {
+
+ if (document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) {
+ var astra_menu_toggle = __main_header_all[i].querySelectorAll('.ast-header-break-point .main-header-menu .menu-item-has-children > .menu-link, .ast-header-break-point ul.main-header-menu .ast-menu-toggle');
+ } else {
+ var astra_menu_toggle = __main_header_all[i].querySelectorAll('ul.main-header-menu .ast-menu-toggle');
+ }
+
+ // Add Eventlisteners for Submenu.
+ if (astra_menu_toggle.length > 0) {
+ for (var j = 0; j < astra_menu_toggle.length; j++) {
+ astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false);
+ }
+ }
+
+ }
+ }
+ }
+ };
+
+ astraNavMenuToggle = function ( event ) {
+ event.preventDefault();
+ var __main_header_all = document.querySelectorAll('.main-header-bar-navigation');
+ var event_index = this.getAttribute('data-index');
+
+ if ('undefined' === typeof __main_header_all[event_index]) {
+ return false;
+ }
+
+ var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children');
+ for (var i = 0; i < menuHasChildren.length; i++) {
+ menuHasChildren[i].classList.remove('ast-submenu-expanded');
+ var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu');
+ for (var j = 0; j < menuHasChildrenSubMenu.length; j++) {
+ menuHasChildrenSubMenu[j].style.display = 'none';
+ }
+ }
+
+ var menu_class = this.getAttribute('class') || '';
+
+ if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) {
+ astraToggleClass(__main_header_all[event_index], 'toggle-on');
+ astraToggleClass(menu_toggle_all[event_index], 'toggled');
+ if (__main_header_all[event_index].classList.contains('toggle-on')) {
+ __main_header_all[event_index].style.display = 'block';
+ document.body.classList.add("ast-main-header-nav-open");
+ } else {
+ __main_header_all[event_index].style.display = '';
+ document.body.classList.remove("ast-main-header-nav-open");
+ }
+ }
+ };
+
+ document.body.addEventListener("astra-header-responsive-enabled", function () {
+
+ var __main_header_all = document.querySelectorAll('.main-header-bar-navigation');
+
+ if (__main_header_all.length > 0) {
+
+ for (var i = 0; i < __main_header_all.length; i++) {
+ if (null != __main_header_all[i]) {
+ __main_header_all[i].classList.remove('toggle-on');
+ __main_header_all[i].style.display = '';
+ }
+
+ var sub_menu = __main_header_all[i].getElementsByClassName('sub-menu');
+ for (var j = 0; j < sub_menu.length; j++) {
+ sub_menu[j].style.display = '';
+ }
+ var child_menu = __main_header_all[i].getElementsByClassName('children');
+ for (var k = 0; k < child_menu.length; k++) {
+ child_menu[k].style.display = '';
+ }
+
+ var searchIcons = __main_header_all[i].getElementsByClassName('ast-search-menu-icon');
+ for (var l = 0; l < searchIcons.length; l++) {
+ searchIcons[l].classList.remove('ast-dropdown-active');
+ searchIcons[l].style.display = '';
+ }
+ }
+ }
+ }, false);
+
+ window.addEventListener('resize', function () {
+ // Skip resize event when keyboard display event triggers on devices.
+ if( 'INPUT' !== document.activeElement.tagName ) {
+ updateHeaderBreakPoint();
+ AstraToggleSetup();
+ }
+ });
+
+ document.addEventListener('DOMContentLoaded', function () {
+ AstraToggleSetup();
+ /**
+ * Navigation Keyboard Navigation.
+ */
+ var container, count;
+
+ container = document.querySelectorAll( '.navigation-accessibility' );
+
+ for ( count = 0; count <= container.length - 1; count++ ) {
+ if ( container[count] ) {
+ navigation_accessibility( container[count] );
+ }
+ }
+ });
+
+
+ var get_browser = function () {
+ var ua = navigator.userAgent,tem,M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
+ if(/trident/i.test(M[1])) {
+ tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
+ return;
+ }
+ if( 'Chrome' === M[1] ) {
+ tem = ua.match(/\bOPR|Edge\/(\d+)/)
+ if(tem != null) {
+ return;
+ }
+ }
+ M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
+ if((tem = ua.match(/version\/(\d+)/i)) != null) {
+ M.splice(1,1,tem[1]);
+ }
+
+ var bodyElement = document.body;
+ if( 'Safari' === M[0] && M[1] < 11 ) {
+ bodyElement.classList.add( "ast-safari-browser-less-than-11" );
+ }
+ }
+
+ get_browser();
+
+ /* Search Script */
+ var SearchIcons = document.getElementsByClassName( 'astra-search-icon' );
+ for (var i = 0; i < SearchIcons.length; i++) {
+
+ SearchIcons[i].onclick = function(event) {
+ if ( this.classList.contains( 'slide-search' ) ) {
+ event.preventDefault();
+ var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' );
+ if ( ! sibling.classList.contains( 'ast-dropdown-active' ) ) {
+ sibling.classList.add( 'ast-dropdown-active' );
+ sibling.querySelector( '.search-field' ).setAttribute('autocomplete','off');
+ setTimeout(function() {
+ sibling.querySelector( '.search-field' ).focus();
+ },200);
+ } else {
+ var searchTerm = sibling.querySelector( '.search-field' ).value || '';
+ if( '' !== searchTerm ) {
+ sibling.querySelector( '.search-form' ).submit();
+ }
+ sibling.classList.remove( 'ast-dropdown-active' );
+ }
+ }
+ }
+ }
+
+ /* Hide Dropdown on body click*/
+ document.body.onclick = function( event ) {
+ if ( typeof event.target.classList !== 'undefined' ) {
+ if ( ! event.target.classList.contains( 'ast-search-menu-icon' ) && astraGetParents( event.target, '.ast-search-menu-icon' ).length === 0 && astraGetParents( event.target, '.ast-search-icon' ).length === 0 ) {
+ var dropdownSearchWrap = document.getElementsByClassName( 'ast-search-menu-icon' );
+ for (var i = 0; i < dropdownSearchWrap.length; i++) {
+ dropdownSearchWrap[i].classList.remove( 'ast-dropdown-active' );
+ }
+ }
+ }
+ }
+
+ /**
+ * Navigation Keyboard Navigation.
+ */
+ function navigation_accessibility( container ) {
+ if ( ! container ) {
+ return;
+ }
+
+ var button = container.getElementsByTagName( 'button' )[0];
+ if ( 'undefined' === typeof button ) {
+ button = container.getElementsByTagName( 'a' )[0];
+ if ( 'undefined' === typeof button ) {
+ return;
+ }
+ }
+
+ var menu = container.getElementsByTagName( 'ul' )[0];
+
+ // Hide menu toggle button if menu is empty and return early.
+ if ( 'undefined' === typeof menu ) {
+ button.style.display = 'none';
+ return;
+ }
+
+ menu.setAttribute( 'aria-expanded', 'false' );
+ if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
+ menu.className += ' nav-menu';
+ }
+
+ button.onclick = function() {
+ if ( -1 !== container.className.indexOf( 'toggled' ) ) {
+ container.className = container.className.replace( ' toggled', '' );
+ button.setAttribute( 'aria-expanded', 'false' );
+ menu.setAttribute( 'aria-expanded', 'false' );
+ } else {
+ container.className += ' toggled';
+ button.setAttribute( 'aria-expanded', 'true' );
+ menu.setAttribute( 'aria-expanded', 'true' );
+ }
+ };
+
+ // Get all the link elements within the menu.
+ var links = menu.getElementsByTagName( 'a' );
+ var subMenus = menu.getElementsByTagName( 'ul' );
+
+
+ // Set menu items with submenus to aria-haspopup="true".
+ for ( var i = 0, len = subMenus.length; i < len; i++ ) {
+ subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' );
+ }
+
+ // Each time a menu link is focused or blurred, toggle focus.
+ for ( i = 0, len = links.length; i < len; i++ ) {
+ links[i].addEventListener( 'focus', toggleFocus, true );
+ links[i].addEventListener( 'blur', toggleBlurFocus, true );
+ links[i].addEventListener( 'click', toggleClose, true );
+ }
+ }
+
+ /**
+ * Close the Toggle Menu on Click on hash (#) link.
+ *
+ * @since 1.3.2
+ * @return void
+ */
+ function toggleClose( )
+ {
+ var self = this || '',
+ hash = '#';
+
+ if( self && ! self.classList.contains('astra-search-icon') ) {
+ var link = new String( self );
+ if( link.indexOf( hash ) !== -1 ) {
+ var link_parent = self.parentNode;
+ if ( document.body.classList.contains('ast-header-break-point') && ! ( document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link") && link_parent.classList.contains("menu-item-has-children") ) ) {
+
+ /* Close Main Header Menu */
+ var main_header_menu_toggle = document.querySelector( '.main-header-menu-toggle' );
+ main_header_menu_toggle.classList.remove( 'toggled' );
+
+ var main_header_bar_navigation = document.querySelector( '.main-header-bar-navigation' );
+ main_header_bar_navigation.classList.remove( 'toggle-on' );
+
+ main_header_bar_navigation.style.display = 'none';
+
+ /* Close Below Header Menu */
+ var before_header_menu_toggle = document.querySelector( '.menu-below-header-toggle' );
+ var before_header_bar_navigation = document.querySelector( '.ast-below-header' );
+ var before_header_bar = document.querySelector( '.ast-below-header-actual-nav' );
+
+ if ( before_header_menu_toggle && before_header_bar_navigation && before_header_bar ) {
+ before_header_menu_toggle.classList.remove( 'toggled' );
+ before_header_bar_navigation.classList.remove( 'toggle-on' );
+ before_header_bar.style.display = 'none';
+ }
+
+ /* Close After Header Menu */
+ var after_header_menu_toggle = document.querySelector( '.menu-above-header-toggle' );
+ var after_header_bar_navigation = document.querySelector( '.ast-above-header' );
+ var after_header_bar = document.querySelector( '.ast-above-header-navigation' );
+
+ if ( after_header_menu_toggle && after_header_bar_navigation && after_header_bar ) {
+ after_header_menu_toggle.classList.remove( 'toggled' );
+ after_header_bar_navigation.classList.remove( 'toggle-on' );
+ after_header_bar.style.display = 'none';
+ }
+
+ astraTriggerEvent( document.querySelector('body'), 'astraMenuHashLinkClicked' );
+ } else {
+ while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
+ // On li elements toggle the class .focus.
+ if ( 'li' === self.tagName.toLowerCase() ) {
+ if ( -1 !== self.className.indexOf( 'focus' ) ) {
+ self.className = self.className.replace( ' focus', '' );
+ }
+ }
+ self = self.parentElement;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Sets or removes .focus class on an element on focus.
+ */
+ function toggleFocus() {
+ var self = this;
+ // Move up through the ancestors of the current link until we hit .nav-menu.
+ while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
+
+ // On li elements toggle the class .focus.
+ if ( 'li' === self.tagName.toLowerCase() ) {
+ if ( -1 !== self.className.indexOf( 'focus' ) ) {
+ self.className = self.className.replace( ' focus', '' );
+ } else {
+ self.className += ' focus';
+ }
+ }
+
+ self = self.parentElement;
+ }
+ }
+
+ /**
+ * Sets or removes .focus class on an element on blur.
+ */
+ function toggleBlurFocus() {
+ var self = this || '',
+ hash = '#';
+ var link = new String( self );
+ if( link.indexOf( hash ) !== -1 && document.body.classList.contains('ast-mouse-clicked') ) {
+ return;
+ }
+ // Move up through the ancestors of the current link until we hit .nav-menu.
+ while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
+
+ // On li elements toggle the class .focus.
+ if ( 'li' === self.tagName.toLowerCase() ) {
+ if ( -1 !== self.className.indexOf( 'focus' ) ) {
+ self.className = self.className.replace( ' focus', '' );
+ } else {
+ self.className += ' focus';
+ }
+ }
+
+ self = self.parentElement;
+ }
+ }
+
+ /* Add class if mouse clicked and remove if tab pressed */
+ if ( 'querySelector' in document && 'addEventListener' in window ) {
+ var body = document.body;
+
+ body.addEventListener( 'mousedown', function() {
+ body.classList.add( 'ast-mouse-clicked' );
+ } );
+
+ body.addEventListener( 'keydown', function() {
+ body.classList.remove( 'ast-mouse-clicked' );
+ } );
+ }
+
+} )();