From aa4089e6d78b6412bae1274bfa0c20bbb754c054 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 31 Jul 2014 13:36:05 -0400 Subject: [PATCH] #1930 simple solution for now, wraps images with that opens in new tab --- public/src/forum/topic.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index d6663ed3a9..280a61db44 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -42,8 +42,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT app.enterRoom('topic_' + tid); - browsing.populateOnlineUsers(); - $('.post-content img').addClass('img-responsive'); + processPage($('.topic')); showBottomPostBar(); @@ -334,13 +333,19 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT getPostPrivileges(posts[x].pid); } + processPage(html); + } + + function processPage(element) { browsing.populateOnlineUsers(); app.createUserTooltips(); - app.replaceSelfLinks(html.find('a')); - utils.addCommasToNumbers(html.find('.formatted-number')); - utils.makeNumbersHumanReadable(html.find('.human-readable-number')); - html.find('span.timeago').timeago(); - html.find('.post-content img').addClass('img-responsive'); + app.replaceSelfLinks(element.find('a')); + utils.addCommasToNumbers(element.find('.formatted-number')); + 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(''); + }); postTools.updatePostCount(); showBottomPostBar(); }