From bb685fe52f3a32f0e8a2d86ec7633eae3e63bc1f Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Wed, 16 Nov 2022 03:12:15 +1300 Subject: [PATCH 1/6] Add `Border Thickness` Setting --- inc/styles.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inc/styles.php b/inc/styles.php index 055311e8a..d3a6e9dcd 100644 --- a/inc/styles.php +++ b/inc/styles.php @@ -224,6 +224,13 @@ static function get_general_style_fields( $id, $label ) { 'group' => 'design', 'priority' => 10, ); + $fields['border_thickness'] = array( + 'name' => __( 'Border Thickness', 'siteorigin-panels' ), + 'type' => 'measurement', + 'group' => 'design', + 'default' => '1px', + 'priority' => 11, + ); $fields['border_radius'] = array( 'name' => __( 'Border Radius', 'siteorigin-panels' ), @@ -763,7 +770,7 @@ static function general_style_css( $css, $style ) { } if ( ! empty( $style[ 'border_color' ] ) ) { - $css[ 'border' ] = '1px solid ' . $style['border_color']; + $css[ 'border' ] = ( ! empty( $style['border_thickness'] ) ? $style['border_thickness'] : '1px' ) . ' solid ' . $style['border_color']; } if ( ! empty( $style[ 'font_color' ] ) ) { From 5c845cedb1f82419b0c4d0350be9637e9bd53233 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Wed, 16 Nov 2022 03:13:47 +1300 Subject: [PATCH 2/6] Spacing --- inc/styles.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/styles.php b/inc/styles.php index d3a6e9dcd..fd3f7761e 100644 --- a/inc/styles.php +++ b/inc/styles.php @@ -224,6 +224,7 @@ static function get_general_style_fields( $id, $label ) { 'group' => 'design', 'priority' => 10, ); + $fields['border_thickness'] = array( 'name' => __( 'Border Thickness', 'siteorigin-panels' ), 'type' => 'measurement', From 71ff8dcfcd99701027e45797a0c38775ae53fa28 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Thu, 24 Nov 2022 03:13:25 +1300 Subject: [PATCH 3/6] Styles: Hide `Border Thickness` If `Border Color` isn't set --- js/siteorigin-panels/view/styles.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/js/siteorigin-panels/view/styles.js b/js/siteorigin-panels/view/styles.js index 3918760b5..2dd9d72d9 100644 --- a/js/siteorigin-panels/view/styles.js +++ b/js/siteorigin-panels/view/styles.js @@ -124,6 +124,14 @@ module.exports = Backbone.View.extend( { return el; } ); } + + // Trigger a change event when user selects a color. + panelsOptions.wpColorPickerOptions.change = function( e, ui ) { + setTimeout( function() { + $( e.target ).trigger( 'change' ); + }, 100 ); + }; + this.$( '.so-wp-color-field' ).wpColorPicker( panelsOptions.wpColorPickerOptions ); } @@ -322,6 +330,7 @@ module.exports = Backbone.View.extend( { } ); this.$( '.style-field-toggle .so-toggle-switch-input' ).trigger( 'change' ); + // Conditionally show Background related settings. var $background_image = this.$( '.so-field-background_image_attachment' ), $background_image_display = this.$( '.so-field-background_display' ), $background_image_size = this.$( '.so-field-background_image_size' ); @@ -352,6 +361,25 @@ module.exports = Backbone.View.extend( { $background_image.find( '[name="style[background_image_attachment]"], [name="style[background_image_attachment_fallback]"]' ).on( 'change', soBackgroundImageVisibility ); } + // Conditionally show Border related settings. + var $border_color = this.$( '.so-field-border_color' ), + $border_thickness = this.$( '.so-field-border_thickness' ); + + if ( $border_color.length && $border_thickness.length ) { + var soBorderVisibility = function() { + if ( $border_color.find( '.so-wp-color-field' ).val() ) { + $border_thickness.show(); + $border_thickness.show(); + } else { + $border_thickness.hide(); + $border_thickness.hide(); + } + } + soBorderVisibility(); + $border_color.find( '.so-wp-color-field' ).on( 'change', soBorderVisibility ); + $border_color.find( '.wp-picker-clear' ).on( 'click', soBorderVisibility ); + } + // Allow other plugins to setup custom fields. $( document ).trigger( 'setup_style_fields', this ); } From c7c906172ab86a88ae31c09cff1f65435f3647d6 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Thu, 1 Dec 2022 15:06:32 +1300 Subject: [PATCH 4/6] Resolve Issue That Prevented Parallax From Sometimes Being Disabled When it Wasn't Meant to Be --- inc/styles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/styles.php b/inc/styles.php index 79d31c726..e4eefbc3a 100644 --- a/inc/styles.php +++ b/inc/styles.php @@ -83,7 +83,7 @@ static function register_scripts() { wp_localize_script( 'simpleParallax', 'parallaxStyles', array( 'mobile-breakpoint' => siteorigin_panels_setting( 'mobile-width' ) . 'px', - 'disable-parallax-mobile' => ! empty( siteorigin_panels_setting( 'parallax-mobile' ) ) ?: siteorigin_panels_setting( 'parallax-mobile' ), + 'disable-parallax-mobile' => ! empty( siteorigin_panels_setting( 'parallax-mobile' ) ) ? 'true' : 'false', 'delay' => ! empty( siteorigin_panels_setting( 'parallax-delay' ) ) ? siteorigin_panels_setting( 'parallax-delay' ) : 0.4, 'scale' => ! empty( siteorigin_panels_setting( 'parallax-scale' ) ) ? siteorigin_panels_setting( 'parallax-scale' ) : 1.1, ) ); From 6a504465490a48f913938119c6f02cbf9ebcf0f0 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Fri, 2 Dec 2022 19:52:29 +1300 Subject: [PATCH 5/6] Modern Parallax: Simplify Logic Check --- inc/styles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/styles.php b/inc/styles.php index e4eefbc3a..7a07dbcb4 100644 --- a/inc/styles.php +++ b/inc/styles.php @@ -83,7 +83,7 @@ static function register_scripts() { wp_localize_script( 'simpleParallax', 'parallaxStyles', array( 'mobile-breakpoint' => siteorigin_panels_setting( 'mobile-width' ) . 'px', - 'disable-parallax-mobile' => ! empty( siteorigin_panels_setting( 'parallax-mobile' ) ) ? 'true' : 'false', + 'disable-parallax-mobile' => ! empty( siteorigin_panels_setting( 'parallax-mobile' ) ), 'delay' => ! empty( siteorigin_panels_setting( 'parallax-delay' ) ) ? siteorigin_panels_setting( 'parallax-delay' ) : 0.4, 'scale' => ! empty( siteorigin_panels_setting( 'parallax-scale' ) ) ? siteorigin_panels_setting( 'parallax-scale' ) : 1.1, ) ); From 6f0c2126221df4927aa42545a71fec98d278eb8b Mon Sep 17 00:00:00 2001 From: Andrew Misplon Date: Fri, 2 Dec 2022 20:19:13 +0000 Subject: [PATCH 6/6] Changelog update. --- readme.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.txt b/readme.txt index 9a15ea0d8..16b9c5347 100644 --- a/readme.txt +++ b/readme.txt @@ -107,6 +107,10 @@ SiteOrigin Premium includes access to our professional email support service, pe == Changelog == += 2.20.0 - 02 December 2022 = +* Styles: Added a row, cell, and widget `Border Thickness` setting. +* Parallax: Resolved `Disable Parallax On Mobile` setting bug. + = 2.19.0 - 22 November 2022 = * Styles: Added a row, cell, and widget `Background Image Size` setting.