From 08bc6bf77889871f8fd33afab00c139864650f9a Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Wed, 15 May 2013 11:57:14 -0700 Subject: [PATCH] Fix 'protocolnumber' change event --- ui/scripts/vpc.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index 1d6160a232c..d06ff2ef1ec 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -59,21 +59,14 @@ return $.inArray(name,['protocolnumber']) > -1; }); - if($(this).val() == 'protocolnumber' ){ + if ($(this).val() == 'protocolnumber' ){ $icmpFields.hide(); $otherFields.hide(); - $protocolFields.show(); - } - else{ - $protocolFields.hide(); - $icmpFields.show(); - $otherFields.show(); - } - - if ($(this).val() == 'icmp') { + $protocolFields.show().addClass('required'); + } else if ($(this).val() == 'icmp') { $icmpFields.show(); $icmpFields.attr('disabled', false); - $protocolFields.hide(); + $protocolFields.hide().removeClass('required'); $otherFields.attr('disabled', 'disabled'); $otherFields.hide(); $otherFields.parent().find('label.error').hide(); @@ -84,7 +77,7 @@ $icmpFields.attr('disabled', 'disabled'); $icmpFields.hide(); $icmpFields.parent().find('label.error').hide(); - $protocolFields.hide(); + $protocolFields.hide().removeClass('required'); } }); @@ -98,6 +91,8 @@ ] }); + + setTimeout(function() { args.$select.trigger('change'); }, 100); } },