diff --git a/ui/css/main.css b/ui/css/main.css index d378074f607..6cf443c0e31 100644 --- a/ui/css/main.css +++ b/ui/css/main.css @@ -5407,7 +5407,7 @@ a:hover.add_newtemplatebutton { cursor:hand; } .vmactions_dropdownbox { - width:auto; + width:375px; height:auto; margin:0; padding:0; diff --git a/ui/scripts/cloud.core.instances.js b/ui/scripts/cloud.core.instances.js index 5bd9e061b73..42da5c3c9cf 100644 --- a/ui/scripts/cloud.core.instances.js +++ b/ui/scripts/cloud.core.instances.js @@ -16,8 +16,11 @@ * */ -// Version: @VERSION@ - +// Version: @VERSION@ + +var rowZIndexGlobal = 300; +var rowZIndex = 299; +var currentVMAction = null; function showInstancesTab(p_domainId, p_account) { // Manage VM Tab // Submenus change based on role @@ -112,7 +115,6 @@ function showInstancesTab(p_domainId, p_account) { if (imgUrl != null) { var time = new Date(); $("#spopup .console_box0").css("background", "url("+imgUrl+"&t="+time.getTime()+")"); - $("#spopup .console_box1").css("background", "url("+imgUrl+"&t="+time.getTime()+")"); vmTemplate.everyTime(2000, function() { var time = new Date(); if ((index % 2) == 0) { @@ -1061,17 +1063,9 @@ function showInstancesTab(p_domainId, p_account) { link.data("expanded", false); } break; - case "vm_actions" : - //fix for zIndex bug of IE7 - vmInstance.find('#vm_rows').each(function() { - $(this).css("z-index", "1"); - }); - - vmInstance.find('#vm_actions_container').each(function() { - $(this).css("z-ndex", "2"); - }); - - vmInstance.find("#vm_actions_container").slideDown("fast"); + case "vm_actions" : + if (currentVMAction != null) currentVMAction.hide(); + currentVMAction = vmInstance.find("#vm_actions_container").slideDown("fast"); break; case "vm_actions_close" : vmInstance.find("#vm_actions_container").hide(); @@ -1090,9 +1084,14 @@ function showInstancesTab(p_domainId, p_account) { return false; }); - // FUNCTION: Parses the JSON object for VM Instances and applies it to the vm template - function vmJSONToTemplate(instanceJSON, instanceTemplate) { - instanceTemplate.attr("id","vm"+instanceJSON.id); + // FUNCTION: Parses the JSON object for VM Instances and applies it to the vm template + function vmJSONToTemplate(instanceJSON, instanceTemplate, isNew) { + instanceTemplate.attr("id","vm"+instanceJSON.id); + if (isNew != undefined && isNew) { + instanceTemplate.find("#vm_rows").attr("style", "z-index: "+(rowZIndexGlobal++)); + } else { + instanceTemplate.find("#vm_rows").attr("style", "z-index: "+(rowZIndex--)); + } // Setup var vmName = getVmName(instanceJSON.name, instanceJSON.displayname); @@ -1702,7 +1701,7 @@ function showInstancesTab(p_domainId, p_account) { vmInstance.find("#vm_loading_container").hide(); if (result.jobstatus == 1) { // Succeeded - vmJSONToTemplate(result.virtualmachine[0], vmInstance); + vmJSONToTemplate(result.virtualmachine[0], vmInstance, true); if (result.virtualmachine[0].passwordenabled == 'true') { vmInstance.find(".loadingmessage_container .loadingmessage_top p").html("Your instance has been successfully created. Your new password is : " + result.virtualmachine[0].password + " . Please change it as soon as you log into your new instance"); } else {