summaryrefslogtreecommitdiff
path: root/inc/builder/type/header/above-header/assets/js/unminified
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
committerZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
commit9d4123cee1867ee7199b06bdc92d40611f547ecc (patch)
tree6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/builder/type/header/above-header/assets/js/unminified
downloadblog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.gz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.bz2
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.xz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.zip
Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/.
Diffstat (limited to 'inc/builder/type/header/above-header/assets/js/unminified')
-rw-r--r--inc/builder/type/header/above-header/assets/js/unminified/customizer-preview.js81
1 files changed, 81 insertions, 0 deletions
diff --git a/inc/builder/type/header/above-header/assets/js/unminified/customizer-preview.js b/inc/builder/type/header/above-header/assets/js/unminified/customizer-preview.js
new file mode 100644
index 0000000..1f7d82d
--- /dev/null
+++ b/inc/builder/type/header/above-header/assets/js/unminified/customizer-preview.js
@@ -0,0 +1,81 @@
+/**
+ * This file adds some LIVE to the 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
+ * @since 3.0.0
+ */
+
+( function( $ ) {
+
+ var tablet_break_point = astraBuilderPreview.tablet_break_point || 768,
+ mobile_break_point = astraBuilderPreview.mobile_break_point || 544;
+
+ wp.customize( 'astra-settings[hba-header-height]', function( value ) {
+ value.bind( function( size ) {
+
+ if( size.desktop != '' || size.tablet != '' || size.mobile != '' ) {
+ var dynamicStyle = '';
+ dynamicStyle += '.ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{';
+ dynamicStyle += 'min-height: ' + size.desktop + 'px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '.ast-desktop .ast-above-header-bar .main-header-menu > .menu-item {';
+ dynamicStyle += 'line-height: ' + size.desktop + 'px;';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += '.ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{';
+ dynamicStyle += 'min-height: ' + size.tablet + 'px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += '.ast-above-header-bar .site-above-header-wrap, .ast-mobile-header-wrap .ast-above-header-bar{';
+ dynamicStyle += 'min-height: ' + size.mobile + 'px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ astra_add_dynamic_css( 'hba-header-height', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Border Bottom width.
+ wp.customize( 'astra-settings[hba-header-separator]', function( value ) {
+ value.bind( function( border ) {
+
+ var color = wp.customize( 'astra-settings[hba-header-bottom-border-color]' ).get(),
+ dynamicStyle = '';
+
+ dynamicStyle += '.ast-above-header.ast-above-header-bar, .ast-above-header-bar {';
+ dynamicStyle += 'border-bottom-width: ' + border + 'px;';
+ dynamicStyle += 'border-bottom-style: solid;';
+ dynamicStyle += 'border-color:' + color + ';';
+ dynamicStyle += '}';
+
+ astra_add_dynamic_css( 'hba-header-separator', dynamicStyle );
+
+ } );
+ } );
+
+ // Border Color.
+ astra_css(
+ 'astra-settings[hba-header-bottom-border-color]',
+ 'border-color',
+ '.ast-above-header.ast-above-header-bar, .ast-above-header-bar'
+ );
+
+ // Responsive BG styles > Below Header Row.
+ astra_apply_responsive_background_css( 'astra-settings[hba-header-bg-obj-responsive]', '.ast-above-header.ast-above-header-bar', 'desktop' );
+ astra_apply_responsive_background_css( 'astra-settings[hba-header-bg-obj-responsive]', '.ast-above-header.ast-above-header-bar', 'tablet' );
+ astra_apply_responsive_background_css( 'astra-settings[hba-header-bg-obj-responsive]', '.ast-above-header.ast-above-header-bar', 'mobile' );
+
+ // Advanced CSS Generation.
+ astra_builder_advanced_css( 'section-above-header-builder', '.ast-above-header.ast-above-header-bar' );
+
+ // Advanced Visibility CSS Generation.
+ astra_builder_visibility_css( 'section-above-header-builder', '.ast-above-header-bar', 'grid' );
+
+} )( jQuery );