Replace jQuery.trim() except in 3rd party assets

This commit is contained in:
Kathy Daring 2021-01-07 15:15:15 -07:00
parent c905d21862
commit 489d8042d0
3 changed files with 5 additions and 5 deletions

View File

@ -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() {

View File

@ -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( '&#10060;' );
// 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 ) {

View File

@ -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 ] );