fix double anchors around images

if the image is already inside an anchor dont wrap again
v1.18.x
barisusakli 11 years ago
parent b48571ceb8
commit 1a97302d68

@ -351,7 +351,10 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
utils.makeNumbersHumanReadable(element.find('.human-readable-number'));
element.find('span.timeago').timeago();
element.find('.post-content img:not(.emoji)').addClass('img-responsive').each(function() {
$(this).wrap('<a href="' + $(this).attr('src') + '" target="_blank">');
var $this = $(this);
if (!$this.parent().is('a')) {
$this.wrap('<a href="' + $this.attr('src') + '" target="_blank">');
}
});
postTools.updatePostCount();
showBottomPostBar();

Loading…
Cancel
Save