cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject git commit: updated refs/heads/master to 599dd1a
Date Tue, 05 Nov 2013 22:37:07 GMT
Updated Branches:
  refs/heads/master ac04a9f2e -> 599dd1a6e


multiEdit: extend field hide/show functionality

-Support passing isHidden option as closure, for conditional hide/show
 based on context

-Adds new option format for isHidden option:

return false == show field and all columns (default)
return true == hide only header and form column
return 2 == hide header and form, as well as returned item column -- these
item columns will be skipped over entirely, not just hidden


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

Branch: refs/heads/master
Commit: 599dd1a6e63d350f91c4ef384fa3aea70e178122
Parents: ac04a9f
Author: Brian Federle <brian.federle@citrix.com>
Authored: Tue Nov 5 14:35:05 2013 -0800
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue Nov 5 14:35:05 2013 -0800

----------------------------------------------------------------------
 ui/scripts/network.js              |  6 ++++++
 ui/scripts/ui/widgets/multiEdit.js | 19 +++++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/599dd1a6/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 4196b10..4915691 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -3368,6 +3368,12 @@
                                                     requireValidation: true,
                                                     buttonLabel: 'label.configure',
                                                     action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler)
+                                                },
+                                                isHidden: function(args) {
+                                                    // return 2 == hide header and form,
as well as returned item column
+                                                    // return 2;
+
+                                                    return false;
                                                 }
                                             },
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/599dd1a6/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index 5d973aa..79bb0d4 100755
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -85,6 +85,12 @@
                     return true;
                 }
 
+                var isHidden = $multi.find('th.' + fieldName).hasClass('always-hide');
+
+                if (isHidden) {
+                    return true;
+                }
+                
                 var $td = $('<td>').addClass(fieldName).appendTo($tr);
                 var $input, val;
                 var $addButton = $multi.find('form .button.add-vm:not(.custom-action)').clone();
@@ -264,7 +270,7 @@
 
                 // Align width to main header
                 _medit.refreshItemWidths($multi);
-
+                
                 if (data._hideFields &&
                     $.inArray(fieldName, data._hideFields) > -1) {
                     $td.addClass('disabled');
@@ -891,7 +897,16 @@
             $td.attr('rel', fieldName);
             $td.appendTo($inputForm);
 
-            if (field.isHidden) {
+            var isHidden = $.isFunction(field.isHidden) ?
+                    field.isHidden({ context: context }) : field.isHidden;
+
+            if (isHidden) {
+                // return true == hide only header and form column
+                // return 2 == hide header and form, as well as returned item column
+                if (isHidden === 2) {
+                    $th.addClass('always-hide');
+                }
+
                 $th.hide();
                 $td.hide();
             }


Mime
View raw message