mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/12135] Reduce verbosity in bbfontstyle() by using textarea var.
PHPBB3-12135
This commit is contained in:
parent
9b500538e3
commit
cd14eec8e5
1 changed files with 4 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue