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

Bug #4570: Fix confirm dialog for RoleVM actions

This commit is contained in:
Carlos Martín 2016-06-14 16:58:34 +02:00
parent 503ea65c89
commit a7bcf7d3a3
3 changed files with 13 additions and 2 deletions

View File

@ -478,6 +478,7 @@ define(function(require) {
//before running the action.
$(document).on("click", '.confirm_button', function() {
var dialogInstance = _getDialogInstance(CONFIRM_DIALOG_ID)
dialogInstance.reset();
$('#' + CONFIRM_DIALOG_ID).data('buttonAction', $(this).attr('href'));
$('#' + CONFIRM_DIALOG_ID).data('buttonTab', $(this).parents('.tab').attr('id'));
dialogInstance.show();

View File

@ -45,7 +45,7 @@ define(function(require) {
return selected_nodes;
}
function roleVMElements() {
function roleVMElements(opts) {
var selected_nodes = [];
var dataTable = $('table[id^=datatable_vms]', '#'+TAB_ID+' #'+ROLES_PANEL_ID);
@ -54,6 +54,16 @@ define(function(require) {
selected_nodes.push($(this).val());
});
if (opts && opts.names){
var pairs = [];
$.each(selected_nodes, function(){
pairs.push({id: this, name: OpenNebulaVM.getName(this)});
});
return pairs;
}
return selected_nodes;
}

View File

@ -75,7 +75,7 @@ define(function(require) {
$('#confirm_proceed', dialog).val(actionId);
$('#confirm_tip', dialog).text(tip);
if(button.text) {
if(button && button.text) {
$('.subheader', dialog).html(button.text);
}