diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/LinkPreview/linkpreview.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/LinkPreview/linkpreview.js b/plugins/LinkPreview/linkpreview.js index eae6dfd43..9f0ed6562 100644 --- a/plugins/LinkPreview/linkpreview.js +++ b/plugins/LinkPreview/linkpreview.js @@ -73,11 +73,14 @@ $(function() { } } if (thumb) { - var img = $('<img/>') - .attr('src', thumb) - .attr('width', width) - .attr('title', data.title || data.url || url); - $('#' + id).append(img); + var link = $('<a><img/></a>'); + link.attr('href', url) + .attr('target', '_blank') + .find('img') + .attr('src', thumb) + .attr('width', width) + .attr('title', data.title || data.url || url); + $('#' + id).append(link); } }); } |