aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets/javascript/editor.js
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-02-02 13:39:44 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-02-02 13:39:44 +0100
commit5fff6fc16932f3ca740ac4d4357ca771082f8a1c (patch)
treee88e865db9a14fa28567e2fd175fff5672ddf7c7 /phpBB/assets/javascript/editor.js
parentfecca29328713be500a8a5d391fdd4d2b6b0255b (diff)
parentcd14eec8e5e47bd8d51098bb91b1008fa4bf9032 (diff)
downloadforums-5fff6fc16932f3ca740ac4d4357ca771082f8a1c.tar
forums-5fff6fc16932f3ca740ac4d4357ca771082f8a1c.tar.gz
forums-5fff6fc16932f3ca740ac4d4357ca771082f8a1c.tar.bz2
forums-5fff6fc16932f3ca740ac4d4357ca771082f8a1c.tar.xz
forums-5fff6fc16932f3ca740ac4d4357ca771082f8a1c.zip
Merge remote-tracking branch 'prototech/ticket/12135' into develop
Diffstat (limited to 'phpBB/assets/javascript/editor.js')
-rw-r--r--phpBB/assets/javascript/editor.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js
index 5222de9fee..be3d868f13 100644
--- a/phpBB/assets/javascript/editor.js
+++ b/phpBB/assets/javascript/editor.js
@@ -78,14 +78,13 @@ function bbfontstyle(bbopen, bbclose) {
if (theSelection) {
// Add tags around selection
document.selection.createRange().text = bbopen + theSelection + bbclose;
- document.forms[form_name].elements[text_name].focus();
+ textarea.focus();
theSelection = '';
return;
}
- } else if (document.forms[form_name].elements[text_name].selectionEnd
- && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0)) {
- mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
- document.forms[form_name].elements[text_name].focus();
+ } else if (textarea.selectionEnd && (textarea.selectionEnd - textarea.selectionStart > 0)) {
+ mozWrap(textarea, bbopen, bbclose);
+ textarea.focus();
theSelection = '';
return;
}