From 5cff852b07b83ddf330fcaffd0843eb3cad6d5ee Mon Sep 17 00:00:00 2001 From: thomascube Date: Sat, 31 Jul 2010 09:48:46 +0000 Subject: Disable active spell check in tinyMCE before switching to plaintext mode (#1486870) + focus message field after mode switch --- program/js/app.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'program/js/app.js') diff --git a/program/js/app.js b/program/js/app.js index a9da55744..c4ddb21e2 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -2815,13 +2815,14 @@ function rcube_webmail() tinyMCE.execCommand('mceAddControl', false, props.id); } else { - var thisMCE = tinyMCE.get(props.id), - existingHtml = thisMCE.getContent(); - - if (existingHtml) { + var thisMCE = tinyMCE.get(props.id), existingHtml; + if (thisMCE.plugins.spellchecker && thisMCE.plugins.spellchecker.active) + thisMCE.execCommand('mceSpellCheck', false); + + if (existingHtml = thisMCE.getContent()) { if (!confirm(this.get_label('editorwarning'))) { return false; - } + } this.html2plain(existingHtml, props.id); } tinyMCE.execCommand('mceRemoveControl', false, props.id); -- cgit v1.2.3