diff options
author | Aleksander Machniak <alec@alec.pl> | 2015-03-11 17:04:19 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2015-03-11 17:04:19 +0100 |
commit | b0bb38703e73794a924949effe6df5d8dfd106a0 (patch) | |
tree | 4092c00e4ca7d2937f821c15b63346d3f0107005 /program | |
parent | db71156ab26ed3b60445aa2865f9606ec4515944 (diff) |
Fix bug where spellchecking in HTML editor do not work after switching editor type more than once (#1490311)
Diffstat (limited to 'program')
-rw-r--r-- | program/js/editor.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/program/js/editor.js b/program/js/editor.js index d16c0e88d..3b2d65ec2 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -65,6 +65,15 @@ function rcube_text_editor(config, id) } } + // secure spellchecker requests with Roundcube token + // Note: must be registered only once (#1490311) + if (!tinymce.registered_request_token) { + tinymce.registered_request_token = true; + tinymce.util.XHR.on('beforeSend', function(e) { + e.xhr.setRequestHeader('X-Roundcube-Request', rcmail.env.request_token); + }); + } + // minimal editor if (config.mode == 'identity') { $.extend(conf, { @@ -107,10 +116,6 @@ function rcube_text_editor(config, id) ed.on('keypress', function() { rcmail.compose_type_activity++; }); - // secure spellchecker requests with Roundcube token - tinymce.util.XHR.on('beforeSend', function(e) { - e.xhr.setRequestHeader('X-Roundcube-Request', rcmail.env.request_token); - }); }; // textarea identifier |