2015-07-16 05:06:53 +02:00
|
|
|
/**
|
|
|
|
* Email recipient behaviour.
|
|
|
|
*/
|
|
|
|
|
2017-08-22 00:11:13 +02:00
|
|
|
(function($) {
|
|
|
|
$.entwine('ss', function($) {
|
|
|
|
var recipient = {
|
|
|
|
// Some fields are only visible when HTML email are being sent.
|
|
|
|
updateFormatSpecificFields: function () {
|
|
|
|
var sendPlainChecked = $('input[name="SendPlain"]').is(':checked');
|
2015-07-16 05:06:53 +02:00
|
|
|
|
2017-08-22 00:11:13 +02:00
|
|
|
$('.field.toggle-html-only')[sendPlainChecked ? 'hide' : 'show']();
|
|
|
|
$('.field.toggle-plain-only')[sendPlainChecked ? 'show' : 'hide']();
|
|
|
|
}
|
|
|
|
};
|
2015-07-16 05:06:53 +02:00
|
|
|
|
2017-08-22 00:11:13 +02:00
|
|
|
$('#Form_ItemEditForm .EmailRecipientForm').entwine({
|
|
|
|
onmatch: function () {
|
|
|
|
recipient.updateFormatSpecificFields();
|
|
|
|
},
|
2015-07-16 05:06:53 +02:00
|
|
|
|
2017-08-22 00:11:13 +02:00
|
|
|
onunmatch: function () {
|
|
|
|
this._super();
|
|
|
|
}
|
|
|
|
});
|
2015-07-16 05:06:53 +02:00
|
|
|
|
2017-08-22 00:11:13 +02:00
|
|
|
$('#Form_ItemEditForm .EmailRecipientForm input[name="SendPlain"]').entwine({
|
|
|
|
onchange: function () {
|
|
|
|
recipient.updateFormatSpecificFields();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2015-07-16 05:06:53 +02:00
|
|
|
}(jQuery));
|