diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js index 55f42f37f2..92688b7407 100644 --- a/src/sunstone/public/js/plugins/files-tab.js +++ b/src/sunstone/public/js/plugins/files-tab.js @@ -573,18 +573,18 @@ function updateFileInfo(request,file){ // Listener for edit link for type change $("#div_edit_chg_type_files_link").live("click", function() { - var value_str = $(".value_td_type").text(); $(".value_td_type").html( ''); - $('option[value="'+value_str+'"]').replaceWith(''); + + $('#chg_type_select_files').val(OpenNebula.Helper.image_type(file_info.TYPE)); }); $("#chg_type_select_files").live("change", function() { - var new_value=$("option:selected", this).text(); + var new_value = $(this).val(); Sunstone.runAction("File.chtype", file_info.ID, new_value); Sunstone.runAction("File.showinfo", file_info.ID); }); diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 4cd0188a99..78484517aa 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -740,35 +740,35 @@ function updateImageInfo(request,img){ // Listener for edit link for type change $("#div_edit_chg_type_link").live("click", function() { - var value_str = $(".value_td_type").text(); $(".value_td_type").html( ''); - $('option[value="'+value_str+'"]').replaceWith(''); + + $('#chg_type_select').val(OpenNebula.Helper.image_type(img_info.TYPE)); }); $("#chg_type_select").live("change", function() { - var new_value=$("option:selected", this).text(); + var new_value = $(this).val(); + Sunstone.runAction("Image.chtype", img_info.ID, new_value); - Sunstone.runAction("Image.show", img_info.ID); }); // Listener for edit link for persistency change $("#div_edit_persistency").live("click", function() { - var value_str = $(".value_td_persistency").text(); $(".value_td_persistency").html( ''); - $('option[value="'+value_str+'"]').replaceWith(''); + + $('#persistency_select').val(parseInt(img_info.PERSISTENT) ? "yes" : "no"); }); $("#persistency_select").live("change", function() { - var new_value=$("option:selected", this).text(); + var new_value = $(this).val(); if (new_value=="yes") Sunstone.runAction("Image.persistent",[img_info.ID]);