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