Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 48097F2B1 for ; Mon, 25 Mar 2013 17:52:05 +0000 (UTC) Received: (qmail 31471 invoked by uid 500); 25 Mar 2013 17:52:02 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 31384 invoked by uid 500); 25 Mar 2013 17:52:02 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 30831 invoked by uid 99); 25 Mar 2013 17:52:01 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Mar 2013 17:52:01 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 506B982001E; Mon, 25 Mar 2013 17:52:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bfederle@apache.org To: commits@cloudstack.apache.org Date: Mon, 25 Mar 2013 17:52:08 -0000 Message-Id: <2b819284eaff470c89693b9e1355389f@git.apache.org> In-Reply-To: <5642616fa1734ce7b376ffebf7163ad3@git.apache.org> References: <5642616fa1734ce7b376ffebf7163ad3@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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. 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 Authored: Wed Mar 20 14:34:37 2013 -0700 Committer: Jessica Wang 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 = $('
  • ').append($('').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)); } } });