if ($widget['type'] == 'RichTextEditor') {
$widget['type'] = 'wysiwyg';
- $attributes['class'] .= ' collapsed';
+ $attributes['class'] = 'collapsed';
+ }
+ elseif ($widget['type'] == 'Text') {
+ $attributes['class'] = 'huge';
}
$languages = CRM_Core_I18n::languages(TRUE);
$('body').on('click', 'a.crm-multilingual-edit-button', function(e) {
var $el = $(this),
$form = $el.closest('form'),
- $field = $('#' + $el.data('field'), $form);
+ $field = $('#' + $el.data('field'), $form),
+ wysiwyg = $field.hasClass('crm-form-wysiwyg');
CRM.loadForm($el.attr('href'), {
dialog: {width: '50%', height: '50%'}
})
// Sync the primary language field with what the user has entered on the main form
.on('crmFormLoad', function() {
- $('.default-lang', this).val($field.val());
+ CRM.wysiwyg.setVal($('.default-lang', this), CRM.wysiwyg.getVal($field));
+ $('.default-lang', this).triggerHandler('change');
})
.on('crmFormSubmit', function() {
// Sync the primary language field with what the user has entered in the popup
- $field.val($('.default-lang', this).val());
+ CRM.wysiwyg.setVal($field, CRM.wysiwyg.getVal($('.default-lang', this)));
+ $field.triggerHandler('change');
$el.trigger('crmPopupFormSuccess');
});
e.preventDefault();
CRM.wysiwyg.destroy(item);
$(item).hide().next('.replace-plain').show().html($(item).val());
})
+ .on('change', function() {
+ $(this).next('.replace-plain').html($(this).val());
+ })
.after('<div class="replace-plain" tabindex="0"></div>');
$(item).next('.replace-plain')
.attr('title', ts('Click to edit'))