mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
FIX Selector for HTML/plain email content toggle. Show preview button for both.
This commit is contained in:
parent
802c750a77
commit
e96594247b
@ -258,12 +258,9 @@ class UserDefinedForm_EmailRecipient extends DataObject
|
|||||||
->addExtraClass('toggle-html-only'),
|
->addExtraClass('toggle-html-only'),
|
||||||
TextareaField::create('EmailBody', _t('UserDefinedForm.EMAILBODY', 'Body'))
|
TextareaField::create('EmailBody', _t('UserDefinedForm.EMAILBODY', 'Body'))
|
||||||
->addExtraClass('toggle-plain-only'),
|
->addExtraClass('toggle-plain-only'),
|
||||||
LiteralField::create(
|
LiteralField::create('EmailPreview', $preview)
|
||||||
'EmailPreview',
|
|
||||||
'<div id="EmailPreview" class="field toggle-html-only">' . $preview . '</div>'
|
|
||||||
)
|
|
||||||
));
|
));
|
||||||
|
|
||||||
$fields->fieldByName('Root.EmailContent')->setTitle(_t('UserDefinedForm_EmailRecipient.EMAILCONTENTTAB', 'Email Content'));
|
$fields->fieldByName('Root.EmailContent')->setTitle(_t('UserDefinedForm_EmailRecipient.EMAILCONTENTTAB', 'Email Content'));
|
||||||
|
|
||||||
// Custom rules for sending this field
|
// Custom rules for sending this field
|
||||||
|
@ -5,12 +5,11 @@
|
|||||||
(function ($) {
|
(function ($) {
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
var sendPlain = $('input[name="SendPlain"]');
|
||||||
var recipient = {
|
var recipient = {
|
||||||
// Some fields are only visible when HTML email are being sent.
|
// Some fields are only visible when HTML email are being sent.
|
||||||
updateFormatSpecificFields: function () {
|
updateFormatSpecificFields: function () {
|
||||||
var sendPlainChecked = $('#SendPlain')
|
var sendPlainChecked = sendPlain.is(':checked');
|
||||||
.find('input[type="checkbox"]')
|
|
||||||
.is(':checked');
|
|
||||||
|
|
||||||
$(".field.toggle-html-only")[sendPlainChecked ? 'hide' : 'show']();
|
$(".field.toggle-html-only")[sendPlainChecked ? 'hide' : 'show']();
|
||||||
$(".field.toggle-plain-only")[sendPlainChecked ? 'show' : 'hide']();
|
$(".field.toggle-plain-only")[sendPlainChecked ? 'show' : 'hide']();
|
||||||
@ -27,7 +26,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#SendPlain').entwine({
|
sendPlain.entwine({
|
||||||
onchange: function () {
|
onchange: function () {
|
||||||
recipient.updateFormatSpecificFields();
|
recipient.updateFormatSpecificFields();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user