Fix bug where cancelling switching from HTML to plain text didn't set the flag properly (#7077)

pull/7091/head
Aleksander Machniak 5 years ago
parent 604e814898
commit 57476c09f9

@ -16,6 +16,7 @@ CHANGELOG Roundcube Webmail
- Fix so install-jsdeps.sh removes Bootstrap's sourceMappingURL (#7035)
- Fix so use of Ctrl+A does not scroll the list (#7020)
- Fix/remove useless keyup event handler on username input in logon form (#6970)
- Fix bug where cancelling switching from HTML to plain text didn't set the flag properly (#7077)
RELEASE 1.4.1
-------------

@ -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;
};

@ -183,9 +183,7 @@ function rcube_mail_ui()
else if (rcmail.env.action == 'compose') {
rcmail.addEventListener('fileappended', function(e) { if (e.attachment.complete) attachmentmenu_append(e.item); })
.addEventListener('aftertoggle-editor', function(e) {
window.setTimeout(function() { layout_composeview() }, 200);
if (e && e.mode)
$("select[name='editorSelector']").val(e.mode);
window.setTimeout(function() { layout_composeview(); }, 200);
})
.addEventListener('compose-encrypted', function(e) {
$("select[name='editorSelector']").prop('disabled', e.active);

Loading…
Cancel
Save