You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/03/21 02:04:35 UTC
[21/25] git commit: refs/heads/api_entity - 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.
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/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ae7e5b02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ae7e5b02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ae7e5b02
Branch: refs/heads/api_entity
Commit: ae7e5b025e25e36bef8a8d9f2becfbfa5614196f
Parents: 918a7c7
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Mar 20 14:34:37 2013 -0700
Committer: Jessica Wang <je...@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/incubator-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/incubator-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));
}
}
});