From 320e3a42a8156f14f5f727122658be15fcad0f80 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Fri, 5 Jul 2013 20:28:39 +0530 Subject: [PATCH] CLOUDSTACK-3333: Start port and end port disabled for protocolnumber --- ui/scripts/vpc.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index 310fbb60fc4..b73eba13a0b 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -95,7 +95,8 @@ return name != 'protocolnumber' && name != 'icmptype' && name != 'icmpcode' && - name != 'cidrlist'; + name != 'cidrlist' && + name != 'number'; }); var $portFields = $inputs.filter(function() { var name = $(this).attr('name'); @@ -116,6 +117,7 @@ $icmpFields.hide(); $otherFields.hide(); $protocolFields.show().addClass('required'); + $portFields.show(); } else if ($(this).val() == 'icmp') { $icmpFields.show(); $icmpFields.attr('disabled', false); @@ -123,7 +125,13 @@ $otherFields.attr('disabled', 'disabled'); $otherFields.hide(); $otherFields.parent().find('label.error').hide(); - } else { + } + else if ($(this).val() == 'all'){ + $portFields.attr('disabled', 'disabled'); + $portFields.hide(); + } + + else { $otherFields.show(); $otherFields.parent().find('label.error').hide(); $otherFields.attr('disabled', false); @@ -131,10 +139,6 @@ $icmpFields.hide(); $icmpFields.parent().find('label.error').hide(); $protocolFields.hide().removeClass('required'); - if ($(this).val() == 'all'){ - $portFields.attr('disabled', 'disabled'); - $portFields.hide(); - } } });