From 39b7450cd68ef2cfcedfe933202a21d4ce96e0c5 Mon Sep 17 00:00:00 2001 From: Edi Amin Date: Sat, 8 Sep 2018 21:39:09 +0600 Subject: [PATCH] Update quick edit logic to show/hide Stock qty and Backorders fields --- assets/js/admin/quick-edit.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/js/admin/quick-edit.js b/assets/js/admin/quick-edit.js index a35b54ace50..74f2f94c866 100644 --- a/assets/js/admin/quick-edit.js +++ b/assets/js/admin/quick-edit.js @@ -70,11 +70,11 @@ jQuery(function( $ ) { if ( product_supports_stock_fields ) { if ( 'yes' === manage_stock ) { - $( '.stock_fields' ).show().removeAttr( 'style' ); + $( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).show().removeAttr( 'style' ); $( '.stock_status_field' ).hide(); $( '.manage_stock_field input' ).prop( 'checked', true ); } else { - $( '.stock_qty_field', '.inline-edit-row' ).hide(); + $( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).hide(); $( '.stock_status_field' ).show().removeAttr( 'style' ); $( '.manage_stock_field input' ).prop( 'checked', false ); } @@ -103,10 +103,10 @@ jQuery(function( $ ) { $( '#the-list' ).on( 'change', '.inline-edit-row input[name="_manage_stock"]', function() { if ( $( this ).is( ':checked' ) ) { - $( '.stock_qty_field', '.inline-edit-row' ).show().removeAttr( 'style' ); + $( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).show().removeAttr( 'style' ); $( '.stock_status_field' ).hide(); } else { - $( '.stock_qty_field', '.inline-edit-row' ).hide(); + $( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).hide(); $( '.stock_status_field' ).show().removeAttr( 'style' ); }