mirror of https://github.com/apache/cloudstack.git
Creating new account - switch the context to "All accounts" if it's not "All accounts" that is being selected. (e.g. it's "My accounts" that is being selected).
This commit is contained in:
parent
65f53e3910
commit
b1e649f856
|
|
@ -215,26 +215,26 @@ function initAddAccountDialog() {
|
|||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
$("#leftmenu_account_all_accounts").click();
|
||||
|
||||
//comment the following section for fixing Bug 7452 ("Adding an account under My Account will result in a duplicate")
|
||||
/*
|
||||
var user = json.createuserresponse.user;
|
||||
var item;
|
||||
$.ajax({
|
||||
data: createURL("command=listAccounts&domainid="+user.domainid+"&account="+user.account),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listaccountsresponse.account;
|
||||
if(items != null && items.length > 0)
|
||||
item = items[0];
|
||||
}
|
||||
});
|
||||
accountToMidmenu(item, $midmenuItem1);
|
||||
bindClickToMidMenu($midmenuItem1, accountToRightPanel, getMidmenuId);
|
||||
afterAddingMidMenuItem($midmenuItem1, true);
|
||||
*/
|
||||
if($("#leftmenu_account_all_accounts").hasClass("selected") == false) { //for fixing Bug 7452 ("Adding an account under My Account will result in a duplicate")
|
||||
$("#leftmenu_account_all_accounts").click();
|
||||
}
|
||||
else {
|
||||
var user = json.createuserresponse.user;
|
||||
var item;
|
||||
$.ajax({
|
||||
data: createURL("command=listAccounts&domainid="+user.domainid+"&account="+user.account),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listaccountsresponse.account;
|
||||
if(items != null && items.length > 0)
|
||||
item = items[0];
|
||||
}
|
||||
});
|
||||
accountToMidmenu(item, $midmenuItem1);
|
||||
bindClickToMidMenu($midmenuItem1, accountToRightPanel, getMidmenuId);
|
||||
afterAddingMidMenuItem($midmenuItem1, true);
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
afterAddingMidMenuItem($midmenuItem1, false, parseXMLHttpResponse(XMLHttpResponse));
|
||||
|
|
|
|||
Loading…
Reference in New Issue