summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js7
-rw-r--r--program/js/editor.js3
2 files changed, 8 insertions, 2 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 43e0aa984..65b7c835d 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3789,6 +3789,13 @@ function rcube_webmail()
});
}
+ this.plain2html = function(plainText, id)
+ {
+ this.set_busy(true, 'converting');
+ $(document.getElementById(id)).val('<pre>'+plainText+'</pre>');
+ this.set_busy(false);
+ }
+
/********************************************************/
/********* remote request methods *********/
diff --git a/program/js/editor.js b/program/js/editor.js
index 7f937b2b8..6826af847 100644
--- a/program/js/editor.js
+++ b/program/js/editor.js
@@ -75,9 +75,8 @@ function rcmail_toggle_editor(ishtml, textAreaId, flagElement)
if (ishtml)
{
rcmail.display_spellcheck_controls(false);
- var htmlText = "<pre>" + composeElement.value + "</pre>";
- composeElement.value = htmlText;
+ rcmail.plain2html(composeElement.value, textAreaId);
tinyMCE.execCommand('mceAddControl', true, textAreaId);
if (flagElement && (flag = rcube_find_object(flagElement)))
flag.value = '1';