From 887358f045a51e57196ccb0212ee1410ce86a836 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 28 Oct 2015 15:16:14 -0400 Subject: [PATCH] closes #3784 --- public/src/client/topic/events.js | 1 + public/src/client/topic/posts.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/public/src/client/topic/events.js b/public/src/client/topic/events.js index 7dfe57beed..7e04a5ffae 100644 --- a/public/src/client/topic/events.js +++ b/public/src/client/topic/events.js @@ -118,6 +118,7 @@ define('forum/topic/events', [ editedPostEl.html(data.post.content); editedPostEl.find('img:not(.not-responsive)').addClass('img-responsive'); app.replaceSelfLinks(editedPostEl.find('a')); + posts.wrapImagesInLinks(editedPostEl.parent()); editedPostEl.fadeIn(250); $(window).trigger('action:posts.edited', data); }); diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js index 02fdfbc26f..89c9e70e1d 100644 --- a/public/src/client/topic/posts.js +++ b/public/src/client/topic/posts.js @@ -217,15 +217,19 @@ define('forum/topic/posts', [ utils.addCommasToNumbers(posts.find('.formatted-number')); utils.makeNumbersHumanReadable(posts.find('.human-readable-number')); posts.find('.timeago').timeago(); + Posts.wrapImagesInLinks(posts); + + addBlockquoteEllipses(posts.find('[component="post/content"] > blockquote > blockquote')); + hidePostToolsForDeletedPosts(posts); + }; + + Posts.wrapImagesInLinks = function(posts) { posts.find('[component="post/content"] img:not(.emoji)').each(function() { var $this = $(this); if (!$this.parent().is('a')) { $this.wrap(''); } }); - - addBlockquoteEllipses(posts.find('[component="post/content"] > blockquote > blockquote')); - hidePostToolsForDeletedPosts(posts); }; Posts.showBottomPostBar = function() {