Revision a70fb308

b/ui/static/synnefo.js
98 98
  };
99 99
}
100 100

  
101
function update_confirmations(action_type){
101
function update_confirmations() {
102 102
    // hide all confirm boxes to begin with
103 103
    $('#machines-pane div.confirm_single').hide();
104 104
    $('#machines-pane div.confirm_multiple').hide();
105
    var action_type = [];
105 106
    // standard view only
106 107
    if ($.cookie("view") == '0') {
107 108
        for (var i=0;i<pending_actions.length;i++){
108 109
            // show single confirms
110
            if (pending_actions[i][0] == reboot) {
111
                action_type = 'reboot';
112
            } else if (pending_actions[i][0] == shutdown) {
113
                action_type = 'shutdown';
114
            } else if (pending_actions[i][0] == start) {
115
                action_type = 'start';
116
            } else if (pending_actions[i][0] == console) {
117
                action_type = 'console';
118
            } else {
119
                action_type = 'destroy';
120
            }
109 121
            $("#machines-pane div.machine-container#" + pending_actions[i][1] +
110
              " div." + action_type +
111
              " .confirm_single").show();
122
            " div.actions div." + action_type + " div.confirm_single").show();
112 123
        }
113 124
    }
114 125

  
b/ui/templates/machines_icon.html
309 309
    if (!found)
310 310
        pending_actions.push([reboot, serverID, serverName])
311 311
    // pass the proper action to update confirmation boxes
312
    update_confirmations('reboot');
312
    update_confirmations();
313 313
    return false;
314 314
});
315 315

  
......
334 334
    // no pending action for this server was found, so let's just add it to the list
335 335
    if (!found)
336 336
        pending_actions.push([shutdown, serverID, serverName])
337
    update_confirmations('shutdown');
337
    update_confirmations();
338 338
    return false;
339 339
});
340 340

  
......
359 359
    // no pending action for this server was found, so let's just add it to the list
360 360
    if (!found)
361 361
        pending_actions.push([start, serverID, serverName])
362
    update_confirmations('start');
362
    update_confirmations();
363 363
    return false;
364 364
});
365 365

  
......
384 384
    // no pending action for this server was found, so let's just add it to the list
385 385
    if (!found)
386 386
        pending_actions.push([open_console, serverID, serverName])
387
    update_confirmations('console');
387
    update_confirmations();
388 388
    return false;
389 389
});
390 390

  
......
410 410
    // no pending action for this server was found, so let's just add it to the list
411 411
    if (!found)
412 412
        pending_actions.push([destroy, serverID, serverName])
413
    update_confirmations('destroy');
413
    update_confirmations();
414 414
    return false;
415 415
});
416 416

  
417
$("#machinesview-icon.standard div.confirm_single .yes").live('click', function(){
417
$("#machinesview-icon.standard div.confirm_single button.yes").live('click', function(){
418 418
    var serverID = $(this).closest("div.machine-container").attr("id");
419 419
    // if there is a pending action for this server execute it
420 420
    for (i=0; i<pending_actions.length; i++) {
......
449 449
    return false;
450 450
});
451 451

  
452
$("#machinesview-icon.standard div.confirm_single .no").live('click', function(){
452
$("#machinesview-icon.standard div.confirm_single button.no").live('click', function(){
453 453
    // remove the action from the pending list
454 454
    var serverID = $(this).closest("div.machine-container").attr("id");
455 455

  

Also available in: Unified diff