|
|
|
@ -4933,19 +4933,21 @@ function rcube_webmail()
|
|
|
|
|
this.toggle_editor = function(props, obj, e)
|
|
|
|
|
{
|
|
|
|
|
// @todo: this should work also with many editors on page
|
|
|
|
|
var result = this.editor.toggle(props.html, props.noconvert || false),
|
|
|
|
|
control = $('#' + this.editor.id).data('control') || $(e ? e.target : []);
|
|
|
|
|
var mode, result = this.editor.toggle(props.html, props.noconvert || false),
|
|
|
|
|
control = $('#' + this.editor.id).data('control') || $(e ? e.target : []);
|
|
|
|
|
|
|
|
|
|
// satisfy the expectations of aftertoggle-editor event subscribers
|
|
|
|
|
props.mode = props.html && result ? 'html' : 'plain';
|
|
|
|
|
if (result)
|
|
|
|
|
mode = props.html ? 'html' : 'plain';
|
|
|
|
|
else
|
|
|
|
|
mode = props.html ? 'plain' : 'html';
|
|
|
|
|
|
|
|
|
|
// update internal format flag
|
|
|
|
|
$("[name='_is_html']").val(props.mode == 'html' ? 1 : 0);
|
|
|
|
|
$("[name='_is_html']").val(mode == 'html' ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
if (control.is('[type=checkbox]'))
|
|
|
|
|
control.prop('checked', props.mode == 'html');
|
|
|
|
|
control.prop('checked', mode == 'html');
|
|
|
|
|
else
|
|
|
|
|
control.val(props.mode);
|
|
|
|
|
control.val(mode);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|