Revision 2c26b0e7

View differences:

src/sunstone/public/app/sunstone.js
571 571
    dialogElement.foundation('reveal', 'reflow');
572 572

  
573 573
    dialogElement.on('opened.fndtn.reveal', function () {
574
      dialog.onShow(dialog.dialogId);
574
      dialog.onShow(dialogElement);
575 575
    });
576 576

  
577 577
    dialogElement.on('click', '.resetDialog', function() {
src/sunstone/public/app/utils/dialogs/confirm-with-select.js
16 16
    //find out if we are running an action with a parametre on a datatable
17 17
    //items or if its just an action
18 18
    $('#confirm_with_select_proceed', dialog).click(function() {
19
      var action = $(this).val();
20
      var action = Sunstone.getActions[action];
19
      var actionId = dialog.data('buttonAction');
20
      var action = Sunstone.getAction(actionId);
21 21
      var param = $('.resource_list_select', dialog).val();
22 22

  
23 23
      if (!param.length) {
24
        notifyError("You must select a value");
24
        Notifier.notifyError("You must select a value");
25 25
        return false;
26 26
      };
27 27

  
28 28
      if (!action) { 
29
        notifyError("Action " + action + " not defined."); 
29
        Notifier.notifyError("Action " + action + " not defined."); 
30 30
        return false;
31 31
      };
32 32

  
33 33
      var error;
34 34
      switch (action.type){
35 35
      case "multiple": 
36
        error = Sunstone.runAction(action, action.elements(), param);
36
        error = Sunstone.runAction(actionId, action.elements(), param);
37 37
        break;
38 38
      default:
39
        error = Sunstone.runAction(action, param);
39
        error = Sunstone.runAction(actionId, param);
40 40
        break;
41 41
      }
42 42

  
......
53 53
  var _onShow = function(dialog) {
54 54
    var actionId = dialog.data('buttonAction');
55 55
    var tabId = dialog.data('buttonTab');
56
    var button = Sunstone.getButton(tabId, action);
56
    var button = Sunstone.getButton(tabId, actionId);
57 57

  
58 58
    var tip = Locale.tr("You have to confirm this action");
59 59
    if (button.tip == undefined) {
......
67 67
    }
68 68

  
69 69
    $('#confirm_with_select_tip', dialog).text(tip);
70
    $('#confirm_with_select_proceed', dialog).val(action);
71 70

  
72
    var action = Sunstone.getAction(action);
71
    var action = Sunstone.getAction(actionId);
73 72
    var elements = action.elements();
74 73
    if (elements) {
75
      var str = action.split('.');
74
      var str = actionId.split('.');
76 75
      $(".confirm_action", dialog).html(str[1] + ' ' + str[0] + ': ' + elements.join(', '))
77 76
    }
78 77

  
src/sunstone/public/app/utils/dialogs/confirm.js
13 13
    return false;
14 14
  }
15 15

  
16
  var _onShow = function(dialogId) {
17
    var dialog = $('#' + dialogId);
16
  var _onShow = function(dialog) {
18 17
    var actionId = dialog.data('buttonAction');
19 18
    var tabId = dialog.data('buttonTab');
20 19
    var button = Sunstone.getButton(tabId, actionId);
src/sunstone/public/app/utils/resource-select.js
1 1
define(function(require) {
2 2
  var Notifier = require('utils/notifier');
3
  var Locale = require('utils/locale');
3 4
  require('opennebula/cluster');
4 5
  require('opennebula/user');
5 6
  require('opennebula/group');
......
17 18

  
18 19
        if (empty_value) {
19 20
          select_str += '<option class="empty_value" value="">' +
20
                          tr("Please select") + '</option>';
21
                          Locale.tr("Please select") + '</option>';
21 22
        }
22 23

  
23 24
        if (resource == "Cluster") {

Also available in: Unified diff