From 609abe4656b14f783e6f4d09f2640fce98dce856 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 8 Jan 2013 10:04:30 +0100 Subject: [PATCH] [-] FO : Bad checkbox behavior in FF in OPC --- themes/default/js/order-opc.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/themes/default/js/order-opc.js b/themes/default/js/order-opc.js index 6218c4019..6b666b41b 100644 --- a/themes/default/js/order-opc.js +++ b/themes/default/js/order-opc.js @@ -482,17 +482,7 @@ $(function() { // INVOICE ADDRESS $('#invoice_address').click(function() { - if ($('#invoice_address:checked').length > 0) - { - $('#opc_invoice_address').slideDown('slow'); - if ($('#company_invoice').val() === '') - $('#vat_number_block_invoice').hide(); - updateState('invoice'); - updateNeedIDNumber('invoice'); - updateZipCode('invoice'); - } - else - $('#opc_invoice_address').slideUp('slow'); + bindCheckbox(); }); // VALIDATION / CREATION AJAX @@ -627,6 +617,7 @@ $(function() { }); } + bindCheckbox(); bindInputs(); $('#opc_account_form input,select,textarea').change(function() { @@ -639,6 +630,21 @@ $(function() { }); +function bindCheckbox() +{ + if ($('#invoice_address:checked').length > 0) + { + $('#opc_invoice_address').slideDown('slow'); + if ($('#company_invoice').val() === '') + $('#vat_number_block_invoice').hide(); + updateState('invoice'); + updateNeedIDNumber('invoice'); + updateZipCode('invoice'); + } + else + $('#opc_invoice_address').slideUp('slow'); +} + function bindInputs() { // Order message update