From: Marcel Werk Date: Mon, 11 Jun 2018 15:53:24 +0000 (+0200) Subject: open links to attachments in a new window to prevent the loss of form inputs X-Git-Tag: 3.1.4~38 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f87642ed5c6267307481b0edf5ed4c7585c5fdd5;p=GitHub%2FWoltLab%2FWCF.git open links to attachments in a new window to prevent the loss of form inputs --- diff --git a/com.woltlab.wcf/templates/messageFormAttachments.tpl b/com.woltlab.wcf/templates/messageFormAttachments.tpl index 4d12b12e39..8b9248e0a5 100644 --- a/com.woltlab.wcf/templates/messageFormAttachments.tpl +++ b/com.woltlab.wcf/templates/messageFormAttachments.tpl @@ -10,7 +10,7 @@
-

isImage} title="{$attachment->filename}" class="jsImageViewer"{/if}>{$attachment->filename}

+

isImage} title="{$attachment->filename}" class="jsImageViewer"{/if}>{$attachment->filename}

{@$attachment->filesize|filesize}
diff --git a/wcfsetup/install/files/js/WCF.Attachment.js b/wcfsetup/install/files/js/WCF.Attachment.js index 1aac9d0ab9..dd17df5afa 100644 --- a/wcfsetup/install/files/js/WCF.Attachment.js +++ b/wcfsetup/install/files/js/WCF.Attachment.js @@ -396,6 +396,7 @@ if (COMPILER_TARGET_DEFAULT) { // update attachment link var $link = $(''); $link.text($filename).attr('href', attachmentData.url); + $link[0].target = '_blank'; if (attachmentData.isImage != 0) { $link.addClass('jsImageViewer').attr('title', $filename);