new UI - remove "no items available" after adding a new item in middle menu.

This commit is contained in:
Jessica Wang 2010-11-07 11:35:53 -08:00
parent e5ae04f417
commit 756e963cd3
3 changed files with 12 additions and 5 deletions

View File

@ -919,7 +919,7 @@ function portForwardingJsonToTemplate(jsonObj, $template) {
$rowContainer.show();
} else if (result.jobstatus == 2) { //Fail
$spinningWheel.hide();
$("#dialog_alert").text(fromdb(result.jobresult)).dialog("open");
$("#dialog_alert").text(fromdb(result.jobresult.errortext)).dialog("open");
}
}
},
@ -1139,7 +1139,7 @@ function loadBalancerJsonToTemplate(jsonObj, $template) {
$spinningWheel.hide();
$rowContainerEdit.hide();
$rowContainer.show();
$("#dialog_alert").text(fromdb(result.jobresult)).dialog("open");
$("#dialog_alert").text(fromdb(result.jobresult.errortext)).dialog("open");
}
}
},
@ -1204,7 +1204,7 @@ function loadBalancerJsonToTemplate(jsonObj, $template) {
$spinningWheel.hide();
} else if (result.jobstatus == 2) { // Failed
//fail reason ("jobresult") is not returned any more after API refactor....
//$("#dialog_error").text(fromdb(result.jobresult)).dialog("open");
//$("#dialog_error").text(fromdb(result.jobresult.errortext)).dialog("open");
$("#dialog_error").text("Assigning instance to load balancer rule failed").dialog("open");
$spinningWheel.hide();
}
@ -1271,7 +1271,7 @@ function lbVmObjToTemplate(obj, $template) {
$(this).remove();
});
} else if (result.jobstatus == 2) { // Failed
$("#dialog_error").text(fromdb(result.jobresult)).dialog("open");
$("#dialog_error").text(fromdb(result.jobresult.errortext)).dialog("open");
$spinningWheel.hide();
}
}

View File

@ -665,6 +665,13 @@ function afterAddingMidMenuItem($midmenuItem1, isSuccessful, extraMessage) {
if(isSuccessful == true) {
$midmenuItem1.find("#info_icon").removeClass("error").show();
$midmenuItem1.data("afterActionInfo", ("Adding succeeded."));
var $noItemsAvailable = $("#midmenu_container").find("#midmenu_container_no_items_available");
if($noItemsAvailable.length > 0) {
$noItemsAvailable.slideUp("slow", function() {
$(this).remove();
});
}
}
else {
$midmenuItem1.find("#content").addClass("addingfailed");

View File

@ -115,7 +115,7 @@ function afterLoadVolumeJSP() {
bindClickToMidMenu($midmenuItem1, volumeToRightPanel, getMidmenuId);
afterAddingMidMenuItem($midmenuItem1, true);
} else if (result.jobstatus == 2) {
afterAddingMidMenuItem($midmenuItem1, false, fromdb(result.jobresult));
afterAddingMidMenuItem($midmenuItem1, false, fromdb(result.jobresult.errortext));
}
}
},