From 630d08fb49615cce9827d604854d58a78adf6e7d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 10 Dec 2014 06:43:15 -0500
Subject: [PATCH] Assign "mainaction" class to "default" buttons in dialogs

---
 program/js/app.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 95a056e..e0a6d26 100644
--- a/program/js/app.js
+++ b/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;
   };
 

--
Gitblit v1.9.1