1
0
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:
Callum Macrae
2015-05-28 18:05:07 +02:00
parent 44fcdd007f
commit be1d1c7d05
13 changed files with 48 additions and 15 deletions

View File

@@ -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
*/