Refactory: code style

This commit is contained in:
Salva Machí 2020-01-31 09:23:28 +01:00
parent d1dc5f8c20
commit c4a7e19534
1 changed files with 15 additions and 15 deletions

View File

@ -450,26 +450,26 @@ jQuery( function( $ ) {
var data = {};
$( ':input', fields ).each( function(index, elem) {
$( ':input', fields ).each( function( index, elem ) {
var $input = $(elem);
var $input = $( elem );
// Bypass inputs without name att
if (!elem.name) {
if ( ! elem.name ) {
return;
}
// Bypass non-checked checkboxes and radio buttons.
if (($input.is(':radio') || $input.is(':checkbox')) && !$input.is(':checked')) {
if ( ( $input.is( ':radio' ) || $input.is( ':checkbox' ) ) && ! $input.is( ':checked' ) ) {
return;
}
// Bypass disabled fields.
if (true === $input.prop('disabled')) {
if ( true === $input.prop( 'disabled' ) ) {
return;
}
data[elem.name] = elem.value;
data[ elem.name ] = elem.value;
});