a3538b64993be46a917e22bc14b78dd738c8ce09
1 (function (angular
, $, _
) {
2 angular
.module('msgtplui').component('msgtpluiEditContent', {
7 templateUrl
: '~/msgtplui/EditContent.html',
8 controller: function ($scope
, $element
, crmStatus
, crmUiAlert
, dialogService
, $rootScope
) {
9 var ts
= $scope
.ts
= CRM
.ts('msgtplui');
12 $ctrl
.isDisabled = function() {
13 return $ctrl
.options
.disabled
;
16 $ctrl
.monacoOptions = function (opts
) {
17 return angular
.extend({}, {
18 readOnly
: $ctrl
.isDisabled(),
19 wordWrap
: 'wordWrapColumn',
21 wordWrapMinified
: false,
22 wrappingIndent
: 'indent'
26 $ctrl
.openFull = function(title
, fld
, monacoOptions
) {
29 monacoOptions
: $ctrl
.monacoOptions(angular
.extend({crmHeightPct
: 0.80}, monacoOptions
)),
30 openPreview: function(options
) {
31 return $ctrl
.openPreview(options
);
33 record
: $ctrl
.options
.record
,
35 tokenList
: $ctrl
.options
.tokenList
37 var options
= CRM
.utils
.adjustDialogDefaults({
38 // show: {effect: 'slideDown'},
39 dialogClass
: 'msgtplui-dialog',
44 return dialogService
.open('expandedEditDlg', '~/msgtplui/ExpandedEdit.html', model
, options
)
45 // Nothing to do but hide warnings. The field was edited live.
46 .then(function(){}, function(){});
49 $ctrl
.openPreview = function(options
) {
50 $rootScope
.$emit('previewMsgTpl', options
);
55 })(angular
, CRM
.$, CRM
._
);