Fixed conding standards #9259

This commit is contained in:
Claudio Sanches 2015-10-09 11:45:30 -03:00
parent 0248ebdac7
commit 332a0d52ad
2 changed files with 9 additions and 9 deletions

View File

@ -221,18 +221,18 @@ jQuery( function ( $ ) {
// Attribute term table
$( 'table.attributes-table tbody tr:nth-child(odd)' ).addClass( 'alternate' );
// Add js validation for product quick edit panel.
$('#woocommerce-fields .regular_price[type=text], #woocommerce-fields .sale_price[type=text] ').keyup(function() {
var value = jQuery( this ).val();
$( '#woocommerce-fields .regular_price[type=text], #woocommerce-fields .sale_price[type=text]' ).keyup( function() {
var value = $( this ).val();
var regex = new RegExp( '[^\-0-9\%\\' + woocommerce_admin.mon_decimal_point + ']+', 'gi' );
var newvalue = value.replace( regex, '' );
if ( value !== newvalue ) {
jQuery( this ).val( newvalue );
jQuery( document.body ).triggerHandler( 'wc_add_error_tip', [ jQuery( this ), 'i18n_mon_decimal_error' ] );
$( this ).val( newvalue );
$( document.body ).triggerHandler( 'wc_add_error_tip', [ $( this ), 'i18n_mon_decimal_error' ] );
} else {
jQuery( document.body ).triggerHandler( 'wc_remove_error_tip', [ jQuery( this ), 'i18n_mon_decimal_error' ] );
$( document.body ).triggerHandler( 'wc_remove_error_tip', [ $( this ), 'i18n_mon_decimal_error' ] );
}
})
});
});

File diff suppressed because one or more lines are too long