| 1 | (function(angular, $, _) { |
| 2 | |
| 3 | angular.module('crmMailing').directive('crmMailingBlockReview', function (crmMailingPreviewMgr) { |
| 4 | return { |
| 5 | scope: { |
| 6 | crmMailing: '@', |
| 7 | crmMailingAttachments: '@' |
| 8 | }, |
| 9 | templateUrl: '~/crmMailing/BlockReview.html', |
| 10 | link: function (scope, elm, attr) { |
| 11 | scope.$parent.$watch(attr.crmMailing, function(newValue){ |
| 12 | scope.mailing = newValue; |
| 13 | }); |
| 14 | scope.$parent.$watch(attr.crmMailingAttachments, function(newValue){ |
| 15 | scope.attachments = newValue; |
| 16 | }); |
| 17 | scope.crmMailingConst = CRM.crmMailing; |
| 18 | scope.ts = CRM.ts(null); |
| 19 | scope.previewMailing = function previewMailing(mailing, mode) { |
| 20 | return crmMailingPreviewMgr.preview(mailing, mode); |
| 21 | }; |
| 22 | } |
| 23 | }; |
| 24 | }); |
| 25 | |
| 26 | })(angular, CRM.$, CRM._); |