incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [3/36] git commit: multiEdit: Allow disabling fields per-row
Date Fri, 10 Aug 2012 17:50:03 GMT
multiEdit: Allow disabling fields per-row

If _hideFields array is passed with row item data, then field IDs
specified will be disabled, if they are custom button actions.


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

Branch: refs/heads/vpc
Commit: a6f59e31d5931937968fd74b2a12192cab72e5b6
Parents: 81727ad
Author: Brian Federle <brian.federle@citrix.com>
Authored: Fri Aug 10 10:40:33 2012 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Fri Aug 10 10:43:17 2012 -0700

----------------------------------------------------------------------
 ui/css/cloudstack3.css             |    9 +++++++++
 ui/scripts/ui/widgets/multiEdit.js |    9 +++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a6f59e31/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index dc1e5b4..6f7cf93 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -6802,6 +6802,15 @@ div.panel.ui-dialog div.list-view div.fixed-header {
   text-shadow: 0px 1px #FFFFFF;
 }
 
+.multi-edit .disabled .button.custom-action {
+  /*+opacity:50%;*/
+  filter: alpha(opacity=50);
+  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
+  -moz-opacity: 0.5;
+  opacity: 0.5;
+  cursor: not-allowed;
+}
+
 .multi-edit .button.custom-action:hover {
   background: #808080 url(../images/bg-gradients.png);
   color: #FFFFFF;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a6f59e31/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index 9fb39d4..17388bd 100644
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -172,6 +172,8 @@
             $button.html(data && data[fieldName] && data[fieldName]['_buttonLabel']
?
                          _l(data[fieldName]['_buttonLabel']) : _l(field.custom.buttonLabel));
             $button.click(function() {
+              if ($td.hasClass('disabled')) return false;
+              
               var $button = $(this);
 
               field.custom.action({
@@ -187,6 +189,8 @@
                   }
                 }
               });
+
+              return true;
             });
             $button.appendTo($td);
           }
@@ -201,6 +205,11 @@
         var targetWidth = $multi.find('th.' + fieldName).width() + 5;
         $td.width(targetWidth);
 
+        if (data._hideFields &&
+            $.inArray(fieldName, data._hideFields) > -1) {
+          $td.addClass('disabled');
+        }
+
         return true;
       });
 


Mime
View raw message