diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js index 8a641efe03..370e3c06ba 100644 --- a/phpBB/adm/style/editor.js +++ b/phpBB/adm/style/editor.js @@ -176,10 +176,13 @@ function insert_text(text, spaces, popup) /** * Add inline attachment at position */ -function attach_inline() +function attach_inline(index, filename, element) { - insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]'); - document.forms[form_name].elements[text_name].focus(); + insert_text('[attachment=' + index + ']' + filename + '[/attachment]'); + if (element) + { + element.focus(); + } } /** @@ -561,5 +564,4 @@ function getCaretPosition(txtarea) } return (caretPos); -} - +} \ No newline at end of file diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js index 8a641efe03..370e3c06ba 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -176,10 +176,13 @@ function insert_text(text, spaces, popup) /** * Add inline attachment at position */ -function attach_inline() +function attach_inline(index, filename, element) { - insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]'); - document.forms[form_name].elements[text_name].focus(); + insert_text('[attachment=' + index + ']' + filename + '[/attachment]'); + if (element) + { + element.focus(); + } } /** @@ -561,5 +564,4 @@ function getCaretPosition(txtarea) } return (caretPos); -} - +} \ No newline at end of file diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index a134d60b22..525639b3c5 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -307,7 +307,7 @@ function checkForm()