mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge branch '4.3' into 4.4
This commit is contained in:
commit
c5d8bcf5cf
@ -3,34 +3,31 @@
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$(document).ready(function () {
|
||||
|
||||
var sendPlain = $('input[name="SendPlain"]');
|
||||
$.entwine('ss', function($) {
|
||||
var recipient = {
|
||||
// Some fields are only visible when HTML email are being sent.
|
||||
updateFormatSpecificFields: function () {
|
||||
var sendPlainChecked = sendPlain.is(':checked');
|
||||
var sendPlainChecked = $('input[name="SendPlain"]').is(':checked');
|
||||
|
||||
$(".field.toggle-html-only")[sendPlainChecked ? 'hide' : 'show']();
|
||||
$(".field.toggle-plain-only")[sendPlainChecked ? 'show' : 'hide']();
|
||||
$('.field.toggle-html-only')[sendPlainChecked ? 'hide' : 'show']();
|
||||
$('.field.toggle-plain-only')[sendPlainChecked ? 'show' : 'hide']();
|
||||
}
|
||||
};
|
||||
|
||||
$.entwine('udf.recipient', function ($) {
|
||||
$('#Form_ItemEditForm').entwine({
|
||||
$('#Form_ItemEditForm .EmailRecipientForm').entwine({
|
||||
onmatch: function () {
|
||||
recipient.updateFormatSpecificFields();
|
||||
},
|
||||
|
||||
onunmatch: function () {
|
||||
this._super();
|
||||
}
|
||||
});
|
||||
|
||||
sendPlain.entwine({
|
||||
$('#Form_ItemEditForm .EmailRecipientForm input[name="SendPlain"]').entwine({
|
||||
onchange: function () {
|
||||
recipient.updateFormatSpecificFields();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}(jQuery));
|
||||
|
Loading…
Reference in New Issue
Block a user