drupal-civicrm/sites/all/modules/civicrm/ang/crmMailing/BlockReview.js

27 lines
837 B
JavaScript
Raw Permalink Normal View History

2018-01-14 15:10:16 +02:00
(function(angular, $, _) {
angular.module('crmMailing').directive('crmMailingBlockReview', function (crmMailingPreviewMgr) {
return {
scope: {
crmMailing: '@',
crmMailingAttachments: '@'
},
templateUrl: '~/crmMailing/BlockReview.html',
link: function (scope, elm, attr) {
scope.$parent.$watch(attr.crmMailing, function(newValue){
scope.mailing = newValue;
});
scope.$parent.$watch(attr.crmMailingAttachments, function(newValue){
scope.attachments = newValue;
});
scope.crmMailingConst = CRM.crmMailing;
scope.ts = CRM.ts(null);
scope.previewMailing = function previewMailing(mailing, mode) {
return crmMailingPreviewMgr.preview(mailing, mode);
};
}
};
});
})(angular, CRM.$, CRM._);