CRM-15705 - Mailing UI dialog tweaks
authorColeman Watts <coleman@civicrm.org>
Thu, 19 Mar 2015 18:10:46 +0000 (14:10 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 19 Mar 2015 18:10:46 +0000 (14:10 -0400)
js/angular-crmMailing.js
js/angular-crmMailingAB.js

index 0404547a5e47742cde2204253a6ce647dd8f8494..dd0b5c06a8eccca1d585d24bc5447ecf2852e9ba 100644 (file)
         recipients: $scope.recipients
       };
       var options = CRM.utils.adjustDialogDefaults({
+        width: '40%',
         autoOpen: false,
         title: ts('Preview (%1)', {
           1: $scope.getRecipientsEstimate()
     $scope.editOptions = function editOptions(mailing) {
       var options = CRM.utils.adjustDialogDefaults({
         autoOpen: false,
+        width: '40%',
+        height: 'auto',
         title: ts('Edit Options')
       });
       $q.when(crmMetadata.getFields('Mailing')).then(function(fields) {
       };
       var options = CRM.utils.adjustDialogDefaults({
         autoOpen: false,
+        height: 'auto',
+        width: '40%',
         title: ts('Save Template')
       });
       return dialogService.open('saveTemplateDialog', '~/crmMailing/dialog/saveTemplate.html', model, options)
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);
     }