From 8ecdbd8537d34a6f44aa5b005cd6ee0bdf02bbcb Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 22 Mar 2013 12:02:27 -0700 Subject: [PATCH] CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - allow user to delete region whose end point matches the current URL, but set region button on top menu to blank after the region is deleted. --- ui/scripts/regions.js | 4 +++- ui/scripts/ui-custom/regions.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index 14346c89b61..8839dec77c3 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -136,10 +136,12 @@ region.endpoint == "http://localhost:8080/client/" document.location.href == "http://localhost:8080/client/#" */ + /* if(document.location.href.indexOf(region.endpoint) != -1) { cloudStack.dialog.notice({ message: _l('You can not remove the region that you are currently in.') }); return false; - } + } + */ return true; }, action: function(args) { diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js index 4620ea451ea..17bc86cb5ad 100644 --- a/ui/scripts/ui-custom/regions.js +++ b/ui/scripts/ui-custom/regions.js @@ -50,7 +50,10 @@ if(currentRegion != null) { $regionSwitcherButton.find('.title').html(_s(currentRegion.name)).attr('title', _s(currentRegion.name)); - } + } + else { + $regionSwitcherButton.find('.title').html('').attr('title', ''); + } } } });