From b315fbbce0d44d321d68e141057ace35fea934c0 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 19 Mar 2015 14:10:46 -0400 Subject: [PATCH] CRM-15705 - Mailing UI dialog tweaks --- js/angular-crmMailing.js | 5 ++++ js/angular-crmMailingAB.js | 55 +++++++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/js/angular-crmMailing.js b/js/angular-crmMailing.js index 0404547a5e..dd0b5c06a8 100644 --- a/js/angular-crmMailing.js +++ b/js/angular-crmMailing.js @@ -293,6 +293,7 @@ recipients: $scope.recipients }; var options = CRM.utils.adjustDialogDefaults({ + width: '40%', autoOpen: false, title: ts('Preview (%1)', { 1: $scope.getRecipientsEstimate() @@ -305,6 +306,8 @@ $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) { @@ -391,6 +394,8 @@ }; 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) diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index cc23dad906..5b5cef6690 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -165,6 +165,8 @@ }; var options = CRM.utils.adjustDialogDefaults({ autoOpen: false, + height: 'auto', + width: '40%', title: ts('Select Final Mailing (Test %1)', { 1: mailingName.toUpperCase() }) @@ -240,28 +242,37 @@ // 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); } -- 2.25.1