1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 20:40:24 +02:00

Merge pull request #3653 from callumacrae/ticket/13882

[ticket/13882] Lazy load the notification avatars.
This commit is contained in:
Marc Alexander
2015-06-16 12:33:17 +02:00
13 changed files with 54 additions and 15 deletions

View File

@@ -1607,6 +1607,21 @@ phpbb.registerPageDropdowns = function() {
});
};
/**
* Handle avatars to be lazy loaded.
*/
phpbb.lazyLoadAvatars = function loadAvatars() {
$('.avatar[data-src]').each(function () {
var $avatar = $(this);
$avatar
.attr('src', $avatar.data('src'))
.removeAttr('data-src');
});
};
$(window).load(phpbb.lazyLoadAvatars);
/**
* Apply code editor to all textarea elements with data-bbcode attribute
*/