cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [1/2] git commit: Quickview: don't run tabFilter
Date Wed, 24 Oct 2012 20:40:29 GMT
Updated Branches:
  refs/heads/master 61a6aada0 -> 7ed60961f


Quickview: don't run tabFilter

For compact detail view (quickview), don't execute tabFilter, as only
the first tab is rendered in all cases. This prevents excessive API
calls from being made, slowing performance.


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

Branch: refs/heads/master
Commit: 7ed60961f07da153fe8c0249c9f43d775be9bdba
Parents: 7225969
Author: Brian Federle <brian.federle@citrix.com>
Authored: Wed Oct 24 12:35:33 2012 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Wed Oct 24 13:40:15 2012 -0700

----------------------------------------------------------------------
 ui/scripts/ui/widgets/detailView.js |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7ed60961/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 2d2957d..3282968 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -1019,7 +1019,6 @@
     var context = options.context ? options.context : {};
     var updateContext = $detailView.data('view-args').updateContext;
     var compact = options.compact;
-    var tabTotal = 0;
 
     if (updateContext) {
       $.extend($detailView.data('view-args').context, updateContext({
@@ -1035,16 +1034,22 @@
       );
     }
 
-    if (tabFilter) {
+    if (tabFilter && !compact) {
       removedTabs = tabFilter({
         context: context
       });
+    } else if (compact) {
+      removedTabs = $.grep(
+        $.map(
+          tabs,
+          function(value, key) { return key; }
+        ), function(tab, index) { return index > 0; }
+      );
     }
 
     $.each(tabs, function(key, value) {
       // Don't render tab, if filtered out
       if ($.inArray(key, removedTabs) > -1) return true;
-      if (compact && tabTotal) return true;
 
       var propGroup = key;
       var prop = value;
@@ -1062,8 +1067,6 @@
       $tabContent.data('detail-view-tab-id', key);
       $tabContent.data('detail-view-tab-data', value);
 
-      tabTotal++;
-
       return true;
     });
 


Mime
View raw message