Browse Source

Make links in comments open in new tabs

merge-requests/14/head
Ivan Fonseca 8 years ago
parent
commit
4294b17bed
No known key found for this signature in database GPG Key ID: 95A9C856EC788689
  1. 4
      tildes/static/js/behaviors/comment-text.js
  2. 2
      tildes/tildes/templates/macros/comments.jinja2

4
tildes/static/js/behaviors/comment-text.js

@ -0,0 +1,4 @@
$.onmount('[data-js-comment-text]', function() {
// Make all links in comment open in new tab
$(this).find('a').attr('target', '_blank');
});

2
tildes/tildes/templates/macros/comments.jinja2

@ -94,7 +94,7 @@
</ul>
{% endif %}
<div class="comment-text">
<div class="comment-text" data-js-comment-text>
{% if comment.is_removed and 'admin' in request.effective_principals %}
<p class="text-warning">Comment removed</p>
{% endif %}

Loading…
Cancel
Save