cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [08/50] [abbrv] git commit: refs/heads/ui-multiple-pod-ranges - CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - set current region (whose end point matches current URL) to region button and region dropdown on top menu.
Date Mon, 25 Mar 2013 17:52:08 GMT
CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - set current region (whose end point matches
current URL) to region button and region dropdown on top menu.


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

Branch: refs/heads/ui-multiple-pod-ranges
Commit: ae7e5b025e25e36bef8a8d9f2becfbfa5614196f
Parents: 918a7c7
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Wed Mar 20 14:34:37 2013 -0700
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Wed Mar 20 14:34:37 2013 -0700

----------------------------------------------------------------------
 ui/scripts/regions.js           |    3 +--
 ui/scripts/ui-custom/regions.js |   19 ++++++++++++-------
 2 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ae7e5b02/ui/scripts/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index 902d3f8..79557ad 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -29,8 +29,7 @@
               data: regions ? regions : [
                 { id: -1, name: '(Default)' }
               ],
-              activeRegionID: cloudStack.context.users.regionid ?
-                cloudStack.context.users.regionid : 1
+              activeRegionID: cloudStack.context.users[0].regionid
             });
           }
         }); 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ae7e5b02/ui/scripts/ui-custom/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js
index 579cdce..354ecee 100644
--- a/ui/scripts/ui-custom/regions.js
+++ b/ui/scripts/ui-custom/regions.js
@@ -29,23 +29,28 @@
             var data = args.data;
             var activeRegionID = args.activeRegionID;
 
+						var currentRegion;
             $(data).each(function() {
               var region = this;
               var regionName = region.name;
               var $li = $('<li>').append($('<span>').html(_s(region.name)));
 
               $li.data('region-data', region);
-
+							
+							if(document.location.href == region.endpoint) {		
+                currentRegion = region;	
+								$li.addClass('active');
+							}
+							/*
               if (region.id == activeRegionID) {
                 $li.addClass('active');
               }
-              
-              $regionSwitcherButton.find('.title')
-                .html(regionName)
-                .attr('title', regionName);
-              
-              $regionList.append($li);
+              */
+							
+              $regionList.append($li);							
             });
+												
+						$regionSwitcherButton.find('.title').html(_s(currentRegion.name)).attr('title', _s(currentRegion.name));
             
           }
         }
       });


Mime
View raw message