Replace jQuery.trim() except in 3rd party assets
This commit is contained in:
parent
c905d21862
commit
489d8042d0
|
@ -58,7 +58,7 @@
|
|||
} else {
|
||||
$( '#copy-error' ).text( '' );
|
||||
wcClearClipboard();
|
||||
wcSetClipboard( $.trim( $( this ).prev( 'input' ).val() ), $( css_class ) );
|
||||
wcSetClipboard( $( this ).prev( 'input' ).val().trim(), $( css_class ) );
|
||||
}
|
||||
} )
|
||||
.on( 'aftercopy', css_class, function() {
|
||||
|
|
|
@ -34,11 +34,11 @@ jQuery( function ( $ ) {
|
|||
$( '.wc_status_table thead, .wc_status_table tbody' ).each( function() {
|
||||
if ( $( this ).is( 'thead' ) ) {
|
||||
var label = $( this ).find( 'th:eq(0)' ).data( 'export-label' ) || $( this ).text();
|
||||
report = report + '\n### ' + $.trim( label ) + ' ###\n\n';
|
||||
report = report + '\n### ' + label.trim() + ' ###\n\n';
|
||||
} else {
|
||||
$( 'tr', $( this ) ).each( function() {
|
||||
var label = $( this ).find( 'td:eq(0)' ).data( 'export-label' ) || $( this ).find( 'td:eq(0)' ).text();
|
||||
var the_name = $.trim( label ).replace( /(<([^>]+)>)/ig, '' ); // Remove HTML.
|
||||
var the_name = label.trim().replace( /(<([^>]+)>)/ig, '' ); // Remove HTML.
|
||||
|
||||
// Find value
|
||||
var $value_html = $( this ).find( 'td:eq(2)' ).clone();
|
||||
|
@ -47,7 +47,7 @@ jQuery( function ( $ ) {
|
|||
$value_html.find( '.dashicons-no-alt, .dashicons-warning' ).replaceWith( '❌' );
|
||||
|
||||
// Format value
|
||||
var the_value = $.trim( $value_html.text() );
|
||||
var the_value = $value_html.text().trim();
|
||||
var value_array = the_value.split( ', ' );
|
||||
|
||||
if ( value_array.length > 1 ) {
|
||||
|
|
|
@ -314,7 +314,7 @@
|
|||
}
|
||||
|
||||
// Reveal
|
||||
if ( $.trim( form.$singleVariation.text() ) ) {
|
||||
if ( form.$singleVariation.text().trim() ) {
|
||||
form.$singleVariation.slideDown( 200 ).trigger( 'show_variation', [ variation, purchasable ] );
|
||||
} else {
|
||||
form.$singleVariation.show().trigger( 'show_variation', [ variation, purchasable ] );
|
||||
|
|
Loading…
Reference in New Issue