Commit ede6fa18 authored by Christodoulos Psaltis's avatar Christodoulos Psaltis
Browse files

Fix server id in metadata delete and update actions

parent 024d8922
......@@ -645,8 +645,8 @@ $('#editor-1.meta-modal button.create').click( function(){
// intercept click on remove button in metadata edit dialog
$('#editor-1.meta-modal button.remove').live('click', function() {
// get the server id and meta key needed for the ajax call
var serverID = $(this).parent().parent().parent().parent().children("h3").attr('id');
var meta_key = $(this).parent().find("label").text();
var serverID = $(this).closest('div.container').children('h3').attr('id');
var meta_key = $(this).parent().find('label').text();
// make the ajax call and list the new GET results
delete_metadata(serverID, meta_key);
return false;
......@@ -670,9 +670,9 @@ $('#editor-2.meta-modal button.cancel').click( function(){
// intercept click on save button in metadata add dialog
$('#editor-2.meta-modal button.save').live('click', function() {
// get the server id, meta key and meta value needed for the ajax call
var serverID = $(this).parent().children("h3").attr('id');
var meta_key = $(this).parent().find(".content input.key").attr('value');
var meta_value = $(this).parent().find(".content input.value").attr('value');
var serverID = $(this).parent().find('h3').attr('id');
var meta_key = $(this).parent().find('input.key').attr('value');
var meta_value = $(this).parent().find('input.value').attr('value');
// make the ajax call and list the new GET results
add_metadata(serverID, meta_key, meta_value);
// close add metadata and open edit metadata dialog
......
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