Aleksander Machniak
2014-12-10 630d08fb49615cce9827d604854d58a78adf6e7d
Assign "mainaction" class to "default" buttons in dialogs
1 files modified
12 ■■■■■ changed files
program/js/app.js 12 ●●●●● patch | view | raw | blame | history
program/js/app.js
@@ -3427,6 +3427,7 @@
          this.get_label('restoremessage'),
          [{
            text: this.get_label('restore'),
            'class': 'mainaction',
            click: function(){
              ref.restore_compose_form(key, html_mode);
              ref.remove_compose_data(key);  // remove old copy
@@ -3436,6 +3437,7 @@
          },
          {
            text: this.get_label('delete'),
            'class': 'delete',
            click: function(){
              ref.remove_compose_data(key);
              $(this).dialog('close');
@@ -3688,7 +3690,7 @@
      $(this).dialog('close');
    };
    this.show_popup_dialog(html, this.gettext('newresponse'), buttons);
    this.show_popup_dialog(html, this.gettext('newresponse'), buttons, {button_classes: ['mainaction']});
    $('#ffresponsetext').val(text);
    $('#ffresponsename').select();
@@ -5174,6 +5176,7 @@
    this.show_popup_dialog(content, this.get_label('newgroup'),
      [{
        text: this.get_label('save'),
        'class': 'mainaction',
        click: function() {
          var name;
@@ -5201,6 +5204,7 @@
    this.show_popup_dialog(content, this.get_label('grouprename'),
      [{
        text: this.get_label('save'),
        'class': 'mainaction',
        click: function() {
          var name;
@@ -5564,6 +5568,7 @@
    this.show_popup_dialog(content, this.get_label('searchsave'),
      [{
        text: this.get_label('save'),
        'class': 'mainaction',
        click: function() {
          var name;
@@ -6567,6 +6572,11 @@
      width: Math.min(w - 20, width + 36)
    });
    // assign special classes to dialog buttons
    $.each(options.button_classes || [], function(i, v) {
      if (v) $($('.ui-dialog-buttonpane button.ui-button', popup.parent()).get(i)).addClass(v);
    });
    return popup;
  };