From 9a21dec1b609db71bd9ed6b3b74c16d2d8418029 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 18 Dec 2013 19:00:41 -0800 Subject: [PATCH] [ticket/11915] Replace inline onclick event for inserting attachment bbcodes. PHPBB3-11915 --- phpBB/assets/javascript/plupload.js | 12 +++++++++++- .../prosilver/template/posting_attach_body.html | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/phpBB/assets/javascript/plupload.js b/phpBB/assets/javascript/plupload.js index 3e450e9bab..f84a8b0a56 100644 --- a/phpBB/assets/javascript/plupload.js +++ b/phpBB/assets/javascript/plupload.js @@ -218,7 +218,6 @@ phpbb.plupload.updateRow = function(index, downloadUrl) { } row.find('textarea').attr('name', 'comment_list[' + index + ']'); - row.find('.file-inline-bbcode').attr('onclick', 'attach_inline(' + index + ',\'' + attach.real_filename + '\');'); phpbb.plupload.updateHiddenData(row, attach, index); }; @@ -488,6 +487,17 @@ phpbb.plupload.initialize(); +/** + * Insert inline attachment bbcode. + */ + $('#file-list').on('click', '.file-inline-bbcode', function(e) { + var attachId = $(this).parents('.attach-row').attr('data-attach-id'), + index = phpbb.plupload.getIndex(attachId); + + attach_inline(index, phpbb.plupload.data[index].real_filename); + e.preventDefault(); +}); + /** * Delete a file. */ diff --git a/phpBB/styles/prosilver/template/posting_attach_body.html b/phpBB/styles/prosilver/template/posting_attach_body.html index 348aded5c1..8a2004c29b 100644 --- a/phpBB/styles/prosilver/template/posting_attach_body.html +++ b/phpBB/styles/prosilver/template/posting_attach_body.html @@ -64,7 +64,7 @@ {attach_row.FILENAME} -   +