1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-26 06:50:09 +03:00

In extended templates in Sunstone, alt+enter creates a new line, enter submits changes

This commit is contained in:
Tino Vazquez 2014-03-11 12:28:10 +01:00
parent 1afeae3868
commit c780256979
2 changed files with 14 additions and 1 deletions

View File

@ -392,7 +392,7 @@ var user_actions = {
call: OpenNebula.User.update,
callback: function(request) {
notifyMessage(tr("Template updated correctly"));
Sunstone.runAction('User.showinfo',request.request.data[0]);
Sunstone.runAction('User.showinfo',request.request.data[0][0]);
},
error: onError
},

View File

@ -2705,6 +2705,19 @@ function insert_extended_template_table(template_json,resource_type,resource_id,
}
});
// Capture the enter key
$('#new_value').live("keypress", function(e) {
var ev = e || window.event;
var key = ev.keyCode;
if (key == 13 && !ev.altKey)
{
//Get the button the user wants to have clicked
$('#button_add_value', $(this).parent().parent()).click();
ev.preventDefault();
}
})
// Listener for single values
// Listener for key,value pair remove action