Commit 61c68083 authored by Christodoulos Psaltis's avatar Christodoulos Psaltis
Browse files

Server rename action is not pushed to pending

parent 91158726
...@@ -682,7 +682,7 @@ function rename(serverID, serverName){ ...@@ -682,7 +682,7 @@ function rename(serverID, serverName){
} }
// ajax post rename call // ajax post rename call
var payload = { var payload = {
"server": {"name" : serverName} "server": {"name": serverName}
}; };
$.ajax({ $.ajax({
......
...@@ -84,20 +84,12 @@ $(".rename, h5.editable span.name").live('click', function() { ...@@ -84,20 +84,12 @@ $(".rename, h5.editable span.name").live('click', function() {
//rename machine //rename machine
$(".editbuttons .save").live('click', function() { $(".editbuttons .save").live('click', function() {
serverID = $(this).parent().parent().parent().attr("id"); serverID = $(this).closest('.machine').attr("id");
serverName = $(this).parent().parent().find('.name').find('.nametextbox').val(); serverName = $(this).parent().parent().find('.name').find('.nametextbox').val();
var found = false;
$(this).parent().parent().find('.name').html($(this).parent().parent().find('.nametextbox').val()); $(this).parent().parent().find('.name').html($(this).parent().parent().find('.nametextbox').val());
$(this).parent().parent().find(".editbuttons").fadeOut("fast"); $(this).parent().parent().find(".editbuttons").fadeOut("fast");
$(this).parent().parent().find(".rename").fadeIn("slow"); $(this).parent().parent().find(".rename").fadeIn("slow");
for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it rename(serverID, serverName);
if (pending_actions[i][1]==serverID){
pending_actions[i][0] = rename;
found = true
}
}
if (!found) // no pending action for this server was found, so let's just add it to the list
pending_actions.push([rename, serverID, serverName])
return false; return false;
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment