It would be nice to add colorbox support for Lazy module. For example if we have a gallery with a big amount of images, that rendered by colorbox, browser tries to load all of thumbnails. Now there is no way to enable Lazy load for colorbox, but I made patch for this.
I just added simple function, that returns an array of supported widget types:
function _lazy_supported_fields() {
return [
'image',
'colorbox',
];
}
and changed conditions like this:
if ($element['#field_type'] === 'image') {
to this:
if (in_array($element['#field_type'], _lazy_supported_fields(), TRUE)) {
And it works fine.
Comments
Comment #2
gun_dose commentedComment #4
gun_dose commentedSomething strange with commit credits ;)
Comment #5
osman