|
|
@ -4938,21 +4938,19 @@ function rcube_webmail()
|
|
|
|
this.toggle_editor = function(props, obj, e)
|
|
|
|
this.toggle_editor = function(props, obj, e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// @todo: this should work also with many editors on page
|
|
|
|
// @todo: this should work also with many editors on page
|
|
|
|
var result = this.editor.toggle(props.html, props.noconvert || false);
|
|
|
|
var 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
|
|
|
|
// satisfy the expectations of aftertoggle-editor event subscribers
|
|
|
|
props.mode = props.html ? 'html' : 'plain';
|
|
|
|
props.mode = props.html && result ? 'html' : 'plain';
|
|
|
|
|
|
|
|
|
|
|
|
if (!result && e) {
|
|
|
|
// update internal format flag
|
|
|
|
// fix selector value if operation failed
|
|
|
|
$("[name='_is_html']").val(props.mode == 'html' ? 1 : 0);
|
|
|
|
props.mode = props.html ? 'plain' : 'html';
|
|
|
|
|
|
|
|
$(e.target).filter('select').val(props.mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result) {
|
|
|
|
if (control.is('[type=checkbox]'))
|
|
|
|
// update internal format flag
|
|
|
|
control.prop('checked', props.mode == 'html');
|
|
|
|
$("[name='_is_html']").val(props.html ? 1 : 0);
|
|
|
|
else
|
|
|
|
}
|
|
|
|
control.val(props.mode);
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
};
|
|
|
|
};
|
|
|
|