Merge pull request #28005 from woocommerce/fix/issue-27945

Replace jQuery.ready function with recommended way since jQuery 3.0 c…
This commit is contained in:
Rodrigo Primo 2020-10-29 18:06:02 -03:00 committed by GitHub
commit e38d0dfdb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -565,7 +565,7 @@ class WC_Shortcodes {
$single_product = new WP_Query( $args );
?>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
jQuery( function( $ ) {
var $variations_form = $( '[data-product-page-preselected-id="<?php echo esc_attr( $preselected_id ); ?>"]' ).find( 'form.variations_form' );
<?php foreach ( $attributes as $attr => $value ) { ?>

View File

@ -102,7 +102,7 @@ class WC_Shop_Customizer {
$max_notice = __( 'The maximum allowed setting is %d', 'woocommerce' );
?>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
jQuery( function( $ ) {
$( document.body ).on( 'change', '.woocommerce-cropping-control input[type="radio"]', function() {
var $wrapper = $( this ).closest( '.woocommerce-cropping-control' ),
value = $wrapper.find( 'input:checked' ).val();