Merge pull request #5557 from monishdeb/4.6
[civicrm-core.git] / js / angular-crmMailingAB.js
index cc23dad906fe8064847f24536f4d82a6bcd4ca01..5b5cef669050f8c386d527f462c9468baff692a1 100644 (file)
       };
       var options = CRM.utils.adjustDialogDefaults({
         autoOpen: false,
+        height: 'auto',
+        width: '40%',
         title: ts('Select Final Mailing (Test %1)', {
           1: mailingName.toUpperCase()
         })
       // When using dialogService with a button bar, the major button actions
       // need to be registered with the dialog widget (and not embedded in
       // the body of the dialog).
-      var buttons = {};
-      buttons[ts('Submit final mailing')] = function () {
-        crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings[mailingName], [
-          'name',
-          'recipients',
-          'scheduled_date'
-        ]);
-        crmStatus({start: ts('Saving...'), success: ''}, abtest.save())
-          .then(function () {
-            return crmStatus({start: ts('Submitting...'), success: ts('Submitted')},
-              abtest.submitFinal().then(function(r){
-                delete abtest.$CrmMailingABReportCnt;
-                return r;
-              }));
-          })
-          .then(function(){
-            dialogService.close('selectWinnerDialog', abtest);
-          });
-      };
-      buttons[ts('Cancel')] = function () {
-        dialogService.cancel('selectWinnerDialog');
-      };
+      var buttons = [
+        {
+          text: ts('Submit final mailing'),
+          icons: {primary: 'ui-icon-check'},
+          click: function () {
+            crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings[mailingName], [
+              'name',
+              'recipients',
+              'scheduled_date'
+            ]);
+            crmStatus({start: ts('Saving...'), success: ''}, abtest.save())
+              .then(function () {
+                return crmStatus({start: ts('Submitting...'), success: ts('Submitted')},
+                  abtest.submitFinal().then(function(r){
+                    delete abtest.$CrmMailingABReportCnt;
+                    return r;
+                  }));
+              })
+              .then(function(){
+                dialogService.close('selectWinnerDialog', abtest);
+              });
+          }
+        },
+        {
+          text: ts('Cancel'),
+          icons: {primary: 'ui-icon-close'},
+          click: function () {
+            dialogService.cancel('selectWinnerDialog');
+          }
+        }
+      ];
       dialogService.setButtons('selectWinnerDialog', buttons);
     }