cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pran...@apache.org
Subject git commit: updated refs/heads/master to 2d63019
Date Fri, 05 Jul 2013 12:55:04 GMT
Updated Branches:
  refs/heads/master 70f33efa7 -> 2d6301970


CLOUDSTACK-3333: Start port and end port disabled for protocolnumber


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2d630197
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2d630197
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2d630197

Branch: refs/heads/master
Commit: 2d6301970e4071a9b2f06c88acba49670b15d8fe
Parents: 70f33ef
Author: Pranav Saxena <psbits@gmail.com>
Authored: Fri Jul 5 18:19:07 2013 +0530
Committer: Pranav Saxena <psbits@gmail.com>
Committed: Fri Jul 5 18:19:07 2013 +0530

----------------------------------------------------------------------
 ui/scripts/vpc.js | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2d630197/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 7cbf63a..940620b 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -106,7 +106,8 @@
                 return name != 'protocolnumber' &&
                   name != 'icmptype' &&
                   name != 'icmpcode' &&
-                  name != 'cidrlist';
+                  name != 'cidrlist' &&
+                  name != 'number' ;
               });
               $portFields = $inputs.filter(function() {
                 var name = $(this).attr('rel');
@@ -125,18 +126,21 @@
                 $icmpFields.hide();
                 $portFields.show();
                 $protocolFields.show();
+                $portFields.show();
               } else if ($(this).val() == 'icmp') {
                 $icmpFields.show();
                 $protocolFields.hide();
                 $portFields.hide();
-              } else {
+              } 
+               else if ($(this).val() == 'all') {
+                  $portFields.hide();
+                }
+
+                else {
                 $otherFields.show();
                 $icmpFields.hide();
                 $protocolFields.hide();
                 
-                if ($(this).val() == 'all') {
-                  $portFields.hide();
-                }
               }              
             } else {
               //
@@ -179,6 +183,7 @@
                 $icmpFields.hide();
                 $otherFields.hide();
                 $protocolFields.show().addClass('required');
+                $portFields.show();
               } else if ($(this).val() == 'icmp') {
                 $icmpFields.show();
                 $icmpFields.attr('disabled', false);
@@ -186,7 +191,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);
@@ -194,10 +205,6 @@
                 $icmpFields.hide();
                 $icmpFields.parent().find('label.error').hide();
                 $protocolFields.hide().removeClass('required');
-                if ($(this).val() == 'all'){
-                  $portFields.attr('disabled', 'disabled');
-                  $portFields.hide();
-                }
               }              
             }
           });


Mime
View raw message