Merge pull request #25950 from woocommerce/revert-25382-master
Revert "Improved performance when saving variations"
This commit is contained in:
commit
f41302bfe8
|
@ -447,31 +447,7 @@ jQuery( function( $ ) {
|
||||||
* @return {Object}
|
* @return {Object}
|
||||||
*/
|
*/
|
||||||
get_variations_fields: function( fields ) {
|
get_variations_fields: function( fields ) {
|
||||||
|
var data = $( ':input', fields ).serializeJSON();
|
||||||
var data = {};
|
|
||||||
|
|
||||||
$( ':input', fields ).each( function( index, elem ) {
|
|
||||||
|
|
||||||
var $input = $( elem );
|
|
||||||
|
|
||||||
// Bypass inputs without name att
|
|
||||||
if ( ! elem.name ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bypass non-checked checkboxes and radio buttons.
|
|
||||||
if ( ( $input.is( ':radio' ) || $input.is( ':checkbox' ) ) && ! $input.is( ':checked' ) ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bypass disabled fields.
|
|
||||||
if ( true === $input.prop( 'disabled' ) ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
data[ elem.name ] = elem.value;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$( '.variations-defaults select' ).each( function( index, element ) {
|
$( '.variations-defaults select' ).each( function( index, element ) {
|
||||||
var select = $( element );
|
var select = $( element );
|
||||||
|
|
Loading…
Reference in New Issue