use existing $form var to block/unblock

Existing code could cause other `variations_form` elements on the same page to block/unblock as well.
This commit is contained in:
Manos Psychogyiopoulos 2016-07-07 11:07:20 +03:00
parent 1ff19a31b1
commit 90b4d6090e
1 changed files with 3 additions and 3 deletions

View File

@ -118,13 +118,13 @@
// Get a matchihng variation via ajax
data.product_id = $product_id;
$( '.variations_form' ).block({
$form.block( {
message: null,
overlayCSS: {
background: '#fff',
opacity: 0.6
}
});
} );
$xhr = $.ajax( {
url: wc_cart_fragments_params.wc_ajax_url.toString().replace( '%%endpoint%%', 'get_variation' ),
@ -140,7 +140,7 @@
}
},
complete: function() {
$( '.variations_form' ).unblock();
$form.unblock();
}
} );
} else {