Fixing regression from 3e2231d2cb

@BenLubar
This commit is contained in:
Julian Lam
2016-03-27 18:56:21 -04:00
parent 2caae05f4b
commit 28db642050
5 changed files with 83 additions and 53 deletions

View File

@@ -218,6 +218,7 @@ define('forum/topic/posts', [
};
Posts.processPage = function(posts) {
Posts.unloadImages();
Posts.showBottomPostBar();
posts.find('[component="post/content"] img:not(.not-responsive)').addClass('img-responsive');
app.createUserTooltips(posts);
@@ -231,6 +232,15 @@ define('forum/topic/posts', [
hidePostToolsForDeletedPosts(posts);
};
Posts.unloadImages = function() {
var images = components.get('post/content').find('img:not(.not-responsive)');
images.each(function() {
$(this).attr('data-src', $(this).attr('src'));
$(this).attr('data-state', 'unloaded');
$(this).attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
});
};
Posts.loadImages = function(threshold) {
/*
If threshold is defined, images loaded above this threshold will modify