incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [1/2] git commit: VPC UI: Hide tier dropdown if viewing from tier detail view
Date Wed, 15 Aug 2012 20:04:28 GMT
Updated Branches:
  refs/heads/asf-4.0 01f0e979f -> 159285395


VPC UI: Hide tier dropdown if viewing from tier detail view


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

Branch: refs/heads/asf-4.0
Commit: 159285395b268f284391c2ca58aa67cb59cb0e43
Parents: d976b09
Author: Brian Federle <brian.federle@citrix.com>
Authored: Wed Aug 15 10:13:49 2012 -0700
Committer: Alex Huang <alex.huang@citrix.com>
Committed: Wed Aug 15 13:01:18 2012 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15928539/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index d36ae26..363bd33 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -17,6 +17,16 @@
 (function($, cloudStack) {
   var aclMultiEdit = {
     noSelect: true,
+    fieldPreFilter: function(args) {
+      var context = args.context;
+      var hiddenFields = [];
+
+      if (context.networks) { // from tier detail view
+        hiddenFields.push('networkid');
+      }
+
+      return hiddenFields; // Returns fields to be hidden
+    },
     fields: {
       'cidrlist': { edit: true, label: 'label.cidr' },
       'protocol': {
@@ -130,7 +140,8 @@
         $.ajax({
           url: createURL('createNetworkACL'),
           data: $.extend(args.data, {
-            networkid: args.data.networkid
+            networkid: args.context.networks ?
+              args.context.networks[0].id : args.data.networkid
           }),
           dataType: 'json',
           success: function(data) {


Mime
View raw message