plugin updates
This commit is contained in:
@@ -60,6 +60,7 @@ jQuery( function( $ ) {
|
||||
var select2_args = $.extend({
|
||||
placeholder: $this.attr( 'data-placeholder' ) || $this.attr( 'placeholder' ) || '',
|
||||
label: $this.attr( 'data-label' ) || null,
|
||||
required: $this.attr( 'aria-required' ) === 'true' || null,
|
||||
width: '100%'
|
||||
}, getEnhancedSelectFormatString() );
|
||||
|
||||
@@ -104,12 +105,15 @@ jQuery( function( $ ) {
|
||||
placeholder = $statebox.attr( 'placeholder' ) || $statebox.attr( 'data-placeholder' ) || '',
|
||||
$newstate;
|
||||
|
||||
if ( placeholder === wc_country_select_params.i18n_select_state_text ) {
|
||||
placeholder = '';
|
||||
}
|
||||
|
||||
if ( states[ country ] ) {
|
||||
if ( $.isEmptyObject( states[ country ] ) ) {
|
||||
$newstate = $( '<input type="hidden" />' )
|
||||
.prop( 'id', input_id )
|
||||
.prop( 'name', input_name )
|
||||
.prop( 'placeholder', placeholder )
|
||||
.attr( 'data-input-classes', input_classes )
|
||||
.addClass( 'hidden ' + input_classes );
|
||||
$parent.hide().find( '.select2-container' ).remove();
|
||||
@@ -154,8 +158,8 @@ jQuery( function( $ ) {
|
||||
$newstate = $( '<input type="text" />' )
|
||||
.prop( 'id', input_id )
|
||||
.prop( 'name', input_name )
|
||||
.prop('placeholder', placeholder)
|
||||
.attr('data-input-classes', input_classes )
|
||||
.prop( 'placeholder', placeholder )
|
||||
.attr( 'data-input-classes', input_classes )
|
||||
.addClass( 'input-text ' + input_classes );
|
||||
$parent.show().find( '.select2-container' ).remove();
|
||||
$statebox.replaceWith( $newstate );
|
||||
|
||||
Reference in New Issue
Block a user