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:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user