open links to attachments in a new window to prevent the loss of form inputs
authorMarcel Werk <burntime@woltlab.com>
Mon, 11 Jun 2018 15:53:24 +0000 (17:53 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 11 Jun 2018 15:53:24 +0000 (17:53 +0200)
com.woltlab.wcf/templates/messageFormAttachments.tpl
wcfsetup/install/files/js/WCF.Attachment.js

index 4d12b12e3960b626917497f4cbb770477f03b5bc..8b9248e0a5e31641d696471ed6812b0e012c5f4f 100644 (file)
@@ -10,7 +10,7 @@
                                
                                <div>
                                        <div>
-                                               <p><a href="{link controller='Attachment' object=$attachment}{/link}"{if $attachment->isImage} title="{$attachment->filename}" class="jsImageViewer"{/if}>{$attachment->filename}</a></p>
+                                               <p><a href="{link controller='Attachment' object=$attachment}{/link}" target="_blank"{if $attachment->isImage} title="{$attachment->filename}" class="jsImageViewer"{/if}>{$attachment->filename}</a></p>
                                                <small>{@$attachment->filesize|filesize}</small>
                                        </div>
                                        
index 1aac9d0ab9aa804d9e2a1cdafe829c989adb4da7..dd17df5afa0782c2fa4ee0c60c612f5128c48b19 100644 (file)
@@ -396,6 +396,7 @@ if (COMPILER_TARGET_DEFAULT) {
                                        // update attachment link
                                        var $link = $('<a href=""></a>');
                                        $link.text($filename).attr('href', attachmentData.url);
+                                       $link[0].target = '_blank';
                                        
                                        if (attachmentData.isImage != 0) {
                                                $link.addClass('jsImageViewer').attr('title', $filename);