Regions UI: Show (Default) in header if no regions are available

This commit is contained in:
Brian Federle 2013-02-28 16:01:55 -08:00
parent 990071b9d7
commit 260669ad9e
2 changed files with 6 additions and 5 deletions

View File

@ -27,7 +27,7 @@
args.response.success({
data: regions ? regions : [
{ id: -1, name: '(Default region)' }
{ id: -1, name: '(Default)' }
],
activeRegionID: cloudStack.context.users.regionid ?
cloudStack.context.users.regionid : 1

View File

@ -31,18 +31,19 @@
$(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 (region.id == activeRegionID) {
$li.addClass('active');
$regionSwitcherButton.find('.title')
.html(_s(region.name))
.attr('title', _s(region.name));
}
$regionSwitcherButton.find('.title')
.html(regionName)
.attr('title', regionName);
$regionList.append($li);
});
}