aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/styles/subSilver/template/editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/styles/subSilver/template/editor.js')
-rw-r--r--phpBB/styles/subSilver/template/editor.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js
index ef52b65998..3fd5c6b8ad 100644
--- a/phpBB/styles/subSilver/template/editor.js
+++ b/phpBB/styles/subSilver/template/editor.js
@@ -147,12 +147,12 @@ function bbfontstyle(bbopen, bbclose)
*/
function insert_text(text)
{
- if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos)
+ if (document.forms[form_name].elements[text_name].createTextRange && !isNaN(document.forms[form_name].elements[text_name].caretPos))
{
var caretPos = document.forms[form_name].elements[text_name].caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
}
- else if (document.forms[form_name].elements[text_name].selectionStart)
+ else if (!isNaN(document.forms[form_name].elements[text_name].selectionStart))
{
var selStart = document.forms[form_name].elements[text_name].selectionStart;
var selEnd = document.forms[form_name].elements[text_name].selectionEnd;