[2.5] Correctly block UI to prevent attribute issues

Fixes #10115
This commit is contained in:
Mike Jolley 2016-01-20 11:01:18 +00:00
parent b5d7f1de10
commit cc68fdc89a
2 changed files with 5 additions and 4 deletions

View File

@ -270,7 +270,8 @@ jQuery( function( $ ) {
$( 'button.add_attribute' ).on( 'click', function() {
var size = $( '.product_attributes .woocommerce_attribute' ).size();
var attribute = $( 'select.attribute_taxonomy' ).val();
var $wrapper = $( this ).closest( '#product_attributes' ).find( '.product_attributes' );
var $wrapper = $( this ).closest( '#product_attributes' );
var $attributes = $wrapper.find( '.product_attributes' );
var product_type = $( 'select#product-type' ).val();
var data = {
action: 'woocommerce_add_attribute',
@ -288,10 +289,10 @@ jQuery( function( $ ) {
});
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
$wrapper.append( response );
$attributes.append( response );
if ( product_type !== 'variable' ) {
$wrapper.find( '.enable_variation' ).hide();
$attributes.find( '.enable_variation' ).hide();
}
$( document.body ).trigger( 'wc-enhanced-select-init' );

File diff suppressed because one or more lines are too long