mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-28 20:40:24 +02:00
[ticket/13882] Lazy load the notification avatars.
This moves them further down the waterfall, making the page load quicker. PHPBB3-13882
This commit is contained in:
@@ -1612,6 +1612,18 @@ phpbb.registerPageDropdowns = function() {
|
||||
});
|
||||
};
|
||||
|
||||
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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user