Skip to content

Commit

Permalink
fix scrolling bug backend, US states order, dropdown default items
Browse files Browse the repository at this point in the history
  • Loading branch information
RensTillmann committed Jan 4, 2021
1 parent dfbfbdb commit da4b172
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 16 deletions.
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

- [PDF Generator Add-on](https://renstillmann.github.io/super-forms/#/pdf-generator-add-on)

## Jan 04, 2020 - Version 4.9.572

- **Fix:** Builder UI scrolling bug in Firefox browser causing a continues scroll
- **Fix:** When selecting default items for `Dropdown` element it would still display the placeholder instead of the actual selected item
- **Fix:** US States element contained some incorrectly sorted items by alphabet

## Dec 24, 2020 - Version 4.9.571

- **Fix:** Issue with SMTP on older PHP versions due to WordPress moving the class to a different location
Expand Down
4 changes: 2 additions & 2 deletions src/assets/css/backend/create-form-responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
max-height: inherit!important;
}
}
@media only screen and (min-width: 480px) and (max-width: 1145px) {
@media only screen and (min-width: 0px) and (max-width: 1145px) {
.super-switch-forms {
margin-bottom: 5px;
}
Expand Down Expand Up @@ -257,7 +257,7 @@
}
@media only screen and (min-width: 1000px) and (max-width: 1679px) {
.super-element > .super-elements-container > .super-element {
width: 50%;
width: 33%;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/assets/js/backend/create-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@
jQuery(document).ready(function ($) {

$('body.wp-admin').addClass('folded');
init_form_settings_container_heights();

var $doc = $(document),
$super_hints,
Expand Down Expand Up @@ -1120,6 +1121,7 @@
}
// Remember which TAB was active for the last time
SUPER.set_session_data('_super_builder_last_active_panel', $(this).parent().index());
init_form_settings_container_heights();
return false;
});

Expand Down
5 changes: 4 additions & 1 deletion src/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5325,7 +5325,7 @@ function SUPERreCaptcha(){
if($new_placeholder===''){
$new_placeholder += $(this).html();
}else{
$new_placeholder += ','+$(this).html();
$new_placeholder += ', '+$(this).html();
}
}
});
Expand Down Expand Up @@ -5627,6 +5627,9 @@ function SUPERreCaptcha(){
for (ii = 0; ii < innerNodes.length; ii++) {
innerNodes[ii].classList.add('super-active');
}
if(innerNodes.length){
field.classList.add('super-filled');
}
if(typeof default_value === 'undefined') default_value = '';
option = field.querySelector('.super-dropdown-ui .super-item:not(.super-placeholder)[data-value="'+default_value+'"]:not(.super-placeholder)');
if(option){
Expand Down
6 changes: 6 additions & 0 deletions src/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

- [PDF Generator Add-on](https://renstillmann.github.io/super-forms/#/pdf-generator-add-on)

## Jan 04, 2020 - Version 4.9.572

- **Fix:** Builder UI scrolling bug in Firefox browser causing a continues scroll
- **Fix:** When selecting default items for `Dropdown` element it would still display the placeholder instead of the actual selected item
- **Fix:** US States element contained some incorrectly sorted items by alphabet

## Dec 24, 2020 - Version 4.9.571

- **Fix:** Issue with SMTP on older PHP versions due to WordPress moving the class to a different location
Expand Down
2 changes: 1 addition & 1 deletion src/includes/class-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SUPER_Common {

// @since 4.7.7 - US states (currently used by dropdown element only)
public static function us_states(){
return array('Alabama'=>'AL','Alaska'=>'AK','Arizona'=>'AZ','Arkansas'=>'AR','California'=>'CA','Colorado'=>'CO','Connecticut'=>'CT','Delaware'=>'DE','District of Columbia'=>'DC','Florida'=>'FL','Georgia'=>'GA','Hawaii'=>'HI','Idaho'=>'ID','Illinois'=>'IL','Indiana'=>'IN','Iowa'=>'IA','Kansas'=>'KS','Kentucky'=>'KY','Louisiana'=>'LA','Maine'=>'ME','Montana'=>'MT','Nebraska'=>'NE','Nevada'=>'NV','New Hampshire'=>'NH','New Jersey'=>'NJ','New Mexico'=>'NM','New York'=>'NY','North Carolina'=>'NC','North Dakota'=>'ND','Ohio'=>'OH','Oklahoma'=>'OK','Oregon'=>'OR','Maryland'=>'MD','Massachusetts'=>'MA','Michigan'=>'MI','Minnesota'=>'MN','Mississippi'=>'MS','Missouri'=>'MO','Pennsylvania'=>'PA','Rhode Island'=>'RI','South Carolina'=>'SC','South Dakota'=>'SD','Tennessee'=>'TN','Texas'=>'TX','Utah'=>'UT','Vermont'=>'VT','Virginia'=>'VA','Washington'=>'WA','West Virginia'=>'WV','Wisconsin'=>'WI','Wyoming'=>'WY');
return array( 'Alabama'=>'AL', 'Alaska'=>'AK', 'Arizona'=>'AZ', 'Arkansas'=>'AR', 'California'=>'CA', 'Colorado'=>'CO', 'Connecticut'=>'CT', 'Delaware'=>'DE', 'District of Columbia'=>'DC', 'Florida'=>'FL', 'Georgia'=>'GA', 'Hawaii'=>'HI', 'Idaho'=>'ID', 'Illinois'=>'IL', 'Indiana'=>'IN', 'Iowa'=>'IA', 'Kansas'=>'KS', 'Kentucky'=>'KY', 'Louisiana'=>'LA', 'Maine'=>'ME', 'Maryland'=>'MD', 'Massachusetts'=>'MA', 'Michigan'=>'MI', 'Minnesota'=>'MN', 'Mississippi'=>'MS', 'Missouri'=>'MO', 'Montana'=>'MT', 'Nebraska'=>'NE', 'Nevada'=>'NV', 'New Hampshire'=>'NH', 'New Jersey'=>'NJ', 'New Mexico'=>'NM', 'New York'=>'NY', 'North Carolina'=>'NC', 'North Dakota'=>'ND', 'Ohio'=>'OH', 'Oklahoma'=>'OK', 'Oregon'=>'OR', 'Pennsylvania'=>'PA', 'Rhode Island'=>'RI', 'South Carolina'=>'SC', 'South Dakota'=>'SD', 'Tennessee'=>'TN', 'Texas'=>'TX', 'Utah'=>'UT', 'Vermont'=>'VT', 'Virginia'=>'VA', 'Washington'=>'WA', 'West Virginia'=>'WV', 'Wisconsin'=>'WI', 'Wyoming'=>'WY');
}
// @since 4.7.7 - Countries (currently used by dropdown element only)
public static function countries(){
Expand Down
19 changes: 10 additions & 9 deletions src/includes/class-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ public static function get_items($items=array(), $tag, $atts, $prefix='', $setti
// Check if this should be remembered as the default value set via settings
if( ($v['checked']=='true' || $v['checked']==1) ) {
$class .= 'super-default-selected';
$selected_items[] = $v['value'];
}
if( empty($selected_values) ) {
if( ($v['checked']=='true' || $v['checked']==1) ) {
Expand Down Expand Up @@ -1122,7 +1123,6 @@ public static function get_items($items=array(), $tag, $atts, $prefix='', $setti
$atts['placeholder'] = implode(', ', $placeholder);
}
}

if(empty($atts['value'])){
$atts['value'] = implode( ',', $selected_items );
}
Expand Down Expand Up @@ -3287,6 +3287,13 @@ public static function dropdown( $tag, $atts, $inner, $shortcodes=null, $setting

// Get default value
$atts['value'] = self::get_default_value($tag, $atts, $settings, $entry_data);

// @since 4.7.7 - make sure we do not lose the default placeholder
// This is required for dynamic columns
$atts['default_placeholder'] = $atts['placeholder'];
$get_items = self::get_items(array(), $tag, $atts, '', $settings, $entry_data);
$items = $get_items['items'];
$atts = $get_items['atts'];

$result = self::opening_tag( $tag, $atts );
$result .= self::opening_wrapper( $atts, $inner, $shortcodes, $settings );
Expand All @@ -3296,19 +3303,13 @@ public static function dropdown( $tag, $atts, $inner, $shortcodes=null, $setting
if( !isset( $atts['minlength'] ) ) $atts['minlength'] = 0;
if( ($atts['minlength']>1) || ($atts['maxlength']>1) ) $multiple = ' multiple';

// @since 4.7.7 - make sure we do not lose the default placeholder
// This is required for dynamic columns
$atts['default_placeholder'] = $atts['placeholder'];
$get_items = self::get_items(array(), $tag, $atts, '', $settings, $entry_data);
$items = $get_items['items'];
$atts = $get_items['atts'];

$result .= '<input type="hidden" class="super-shortcode-field';
$result .= $distance_calculator_class;
$result .= ($atts['class']!='' ? ' ' . $atts['class'] : '');
$result .= '"';
$result .= ($atts['enable_distance_calculator']=='true' ? $data_attributes : '');
$result .= ' value="' . $atts['value'] . '" name="' . $atts['name'] . '"';
$result .= ' name="' . esc_attr( $atts['name'] ) . '" value="' . $atts['value'] . '"';

$result .= self::common_attributes( $atts, $tag, $settings );
$result .= ' />';

Expand Down
6 changes: 3 additions & 3 deletions src/super-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Plugin Name: Super Forms - Drag & Drop Form Builder
* Plugin URI: http://codecanyon.net/user/feeling4design
* Description: The most advanced, flexible and easy to use form builder for WordPress!
* Version: 4.9.571
* Version: 4.9.572
* Author: feeling4design
* Author URI: http://codecanyon.net/user/feeling4design
* Text Domain: super-forms
Expand All @@ -41,7 +41,7 @@ final class SUPER_Forms {
*
* @since 1.0.0
*/
public $version = '4.9.571';
public $version = '4.9.572';
public $slug = 'super-forms';
public $apiUrl = 'https://api.super-forms.com/';
public $apiVersion = 'v1';
Expand Down Expand Up @@ -128,7 +128,7 @@ final class SUPER_Forms {
public static function instance() {
if(is_null( self::$_instance)){
self::$_instance = new self();
self::$_instance->session = new SUPER_Session();
self::$_instance->session = new SUPER_Session();
}
return self::$_instance;
}
Expand Down

0 comments on commit da4b172

Please sign in to comment.