Only slide payment box up-and-down if > 1 method

This commit is contained in:
Brent Shepherd 2012-10-08 12:01:43 +10:00
parent e04a0b7a23
commit b4cf878f40
1 changed files with 8 additions and 6 deletions

View File

@ -104,12 +104,14 @@ jQuery(document).ready(function($) {
}
$('.payment_methods input.input-radio').live('click', function(){
$('div.payment_box').filter(':visible').slideUp(250);
if ($(this).is(':checked')) {
$('div.payment_box.' + $(this).attr('ID')).slideDown(250);
}
});
if($('.payment_methods input.input-radio').length > 1) {
$('.payment_methods input.input-radio').live('click', function(){
$('div.payment_box').filter(':visible').slideUp(250);
if ($(this).is(':checked')) {
$('div.payment_box.' + $(this).attr('ID')).slideDown(250);
}
});
}
$('#order_review input[name=payment_method]:checked').click();