String.trim() polyfill.

This commit is contained in:
George Stephanis 2015-08-10 17:22:03 -04:00
parent 5e8ef8f18d
commit ce02cd8a5b
1 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,12 @@
(function($, data, wp){ (function($, data, wp){
$(function() { $(function() {
if ( ! String.prototype.trim ) {
String.prototype.trim = function () {
return this.replace( /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '' );
};
}
var rowTemplate = wp.template( 'wc-tax-table-row' ), var rowTemplate = wp.template( 'wc-tax-table-row' ),
paginationTemplate = wp.template( 'wc-tax-table-pagination' ), paginationTemplate = wp.template( 'wc-tax-table-pagination' ),
$table = $( '.wc_tax_rates' ), $table = $( '.wc_tax_rates' ),