diff options
author | Zach van Rijn <me@zv.io> | 2021-07-21 14:54:07 -0500 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2021-07-21 14:54:07 -0500 |
commit | 9d4123cee1867ee7199b06bdc92d40611f547ecc (patch) | |
tree | 6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/builder/type/footer/primary-footer/assets/js/unminified | |
download | blog-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/footer/primary-footer/assets/js/unminified')
-rw-r--r-- | inc/builder/type/footer/primary-footer/assets/js/unminified/customizer-preview.js | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/inc/builder/type/footer/primary-footer/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/primary-footer/assets/js/unminified/customizer-preview.js new file mode 100644 index 0000000..c0e089a --- /dev/null +++ b/inc/builder/type/footer/primary-footer/assets/js/unminified/customizer-preview.js @@ -0,0 +1,124 @@ +/**
+ * 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;
+
+ var section = 'section-primary-footer-builder';
+ var selector = '.site-primary-footer-wrap[data-section="section-primary-footer-builder"]';
+
+ // Primary Header - Layout.
+ wp.customize( 'astra-settings[hb-footer-layout-width]', function( setting ) {
+ setting.bind( function( layout ) {
+
+ var dynamicStyle = '';
+
+ if ( 'content' == layout ) {
+ dynamicStyle = selector + ' .ast-builder-grid-row {';
+ dynamicStyle += 'max-width: ' + AstraBuilderPrimaryFooterData.footer_content_width + 'px;';
+ dynamicStyle += 'margin-left: auto;';
+ dynamicStyle += 'margin-right: auto;';
+ dynamicStyle += '} ';
+ }
+
+ if ( 'full' == layout ) {
+ dynamicStyle = selector + ' .ast-builder-grid-row {';
+ dynamicStyle += 'max-width: 100%;';
+ dynamicStyle += 'padding-right: 35px; padding-left: 35px;';
+ dynamicStyle += '} ';
+ }
+
+ astra_add_dynamic_css( 'hb-footer-layout-width', dynamicStyle );
+
+ } );
+ } );
+
+ // Footer Vertical Alignment.
+ astra_css(
+ 'astra-settings[hb-footer-vertical-alignment]',
+ 'align-items',
+ selector + ' .ast-builder-grid-row, ' + selector + ' .site-footer-section'
+ );
+
+ // Inner Space.
+ wp.customize( 'astra-settings[hb-inner-spacing]', function( value ) {
+ value.bind( function( spacing ) {
+ var dynamicStyle = '';
+ if ( spacing.desktop != '' ) {
+ dynamicStyle += selector + ' .ast-builder-grid-row {';
+ dynamicStyle += 'grid-column-gap: ' + spacing.desktop + 'px;';
+ dynamicStyle += '} ';
+ }
+
+ if ( spacing.tablet != '' ) {
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-builder-grid-row {';
+ dynamicStyle += 'grid-column-gap: ' + spacing.tablet + 'px;';
+ dynamicStyle += 'grid-row-gap: ' + spacing.tablet + 'px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ }
+
+ if ( spacing.mobile != '' ) {
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' .ast-builder-grid-row {';
+ dynamicStyle += 'grid-column-gap: ' + spacing.mobile + 'px;';
+ dynamicStyle += 'grid-row-gap: ' + spacing.mobile + 'px;';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ }
+
+ astra_add_dynamic_css( 'hb-inner-spacing-toggle-button', dynamicStyle );
+ } );
+ } );
+
+ // Border Top width.
+ astra_css(
+ 'astra-settings[hb-footer-main-sep]',
+ 'border-top-width',
+ selector,
+ 'px'
+ );
+
+ // Border Color.
+ astra_css(
+ 'astra-settings[hb-footer-main-sep-color]',
+ 'border-color',
+ selector
+ );
+
+ var dynamicStyle = selector + ' {';
+ dynamicStyle += 'border-top-style: solid';
+ dynamicStyle += '} ';
+
+ astra_add_dynamic_css( 'hb-footer-main-sep-color', dynamicStyle );
+
+ // Responsive BG styles > Primary Footer Row.
+ astra_apply_responsive_background_css( 'astra-settings[hb-footer-bg-obj-responsive]', selector, 'desktop' );
+ astra_apply_responsive_background_css( 'astra-settings[hb-footer-bg-obj-responsive]', selector, 'tablet' );
+ astra_apply_responsive_background_css( 'astra-settings[hb-footer-bg-obj-responsive]', selector, 'mobile' );
+
+ // Responsive BG styles > Global Footer Row.
+ astra_apply_responsive_background_css( 'astra-settings[footer-bg-obj-responsive]', '.site-footer', 'desktop' );
+ astra_apply_responsive_background_css( 'astra-settings[footer-bg-obj-responsive]', '.site-footer', 'tablet' );
+ astra_apply_responsive_background_css( 'astra-settings[footer-bg-obj-responsive]', '.site-footer', 'mobile' );
+
+ // Advanced CSS Generation.
+ astra_builder_advanced_css( section, selector );
+
+ // Advanced CSS for Header Builder.
+ astra_builder_advanced_css( 'section-footer-builder-layout', '.ast-hfb-header .site-footer' );
+
+ // Advanced Visibility CSS Generation.
+ astra_builder_visibility_css( section, selector, 'grid' );
+
+} )( jQuery );
|