From 049a5887eea319eeb2eb76ec989dde99df2d0dc4 Mon Sep 17 00:00:00 2001 From: Guilherme Capanema Date: Thu, 7 Nov 2019 18:21:25 -0300 Subject: [PATCH] =?UTF-8?q?Ajustes=20na=20fun=C3=A7=C3=A3o=20de=20block.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/wc-fvc-public.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/js/wc-fvc-public.js b/public/js/wc-fvc-public.js index 6fc07e1..aee31bf 100755 --- a/public/js/wc-fvc-public.js +++ b/public/js/wc-fvc-public.js @@ -6,10 +6,10 @@ * Initialize actions. */ init: function() { - $( document.body ).on( 'submit', '.woocommerce-shipping-calculator', function(event) { + $( document.body ).on( 'submit', 'form.woocommerce-shipping-calculator', function(event) { event.preventDefault(); - WC_Fvc.block(); + WC_Fvc.block('form.woocommerce-shipping-calculator, div.cart_totals'); var cep = $('#calc_shipping_postcode').val(); @@ -28,6 +28,7 @@ $('#calc_shipping_state').val(address.data.state).change(); $('#calc_shipping_city').val(address.data.city).change(); } + WC_Fvc.unblock('form.woocommerce-shipping-calculator, div.cart_totals'); }, }); }); @@ -36,8 +37,8 @@ /** * Block shipping form. */ - block: function() { - $('.woocommerce-shipping-calculator, div.cart_totals') + block: function(elements) { + $(elements) .addClass('processing') .block({ message: null, @@ -51,8 +52,8 @@ /** * Unblock checkout. */ - unblock: function() { - $('.woocommerce-shipping-calculator, div.cart_totals') + unblock: function(elements) { + $(elements) .removeClass('processing') .unblock(); },