2015-07-16 05:06:53 +02:00
|
|
|
/**
|
|
|
|
* Email recipient behaviour.
|
|
|
|
*/
|
|
|
|
|
|
|
|
(function ($) {
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
var recipient = {
|
|
|
|
// Some fields are only visible when HTML email are being sent.
|
|
|
|
updateFormatSpecificFields: function () {
|
2015-07-24 04:37:48 +02:00
|
|
|
var sendPlainChecked = $('#SendPlain')
|
|
|
|
.find('input[type="checkbox"]')
|
|
|
|
.is(':checked');
|
2015-07-16 05:06:53 +02:00
|
|
|
|
2015-07-24 04:37:48 +02:00
|
|
|
$(".field.toggle-html-only")[sendPlainChecked ? 'hide' : 'show']();
|
|
|
|
$(".field.toggle-plain-only")[sendPlainChecked ? 'show' : 'hide']();
|
2015-07-16 05:06:53 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
$.entwine('udf.recipient', function ($) {
|
|
|
|
$('#Form_ItemEditForm').entwine({
|
|
|
|
onmatch: function () {
|
|
|
|
recipient.updateFormatSpecificFields();
|
|
|
|
},
|
|
|
|
onunmatch: function () {
|
|
|
|
this._super();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#SendPlain').entwine({
|
|
|
|
onchange: function () {
|
|
|
|
recipient.updateFormatSpecificFields();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}(jQuery));
|