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.

CommentFileSizeAuthor
#2 lazy-colorbox-3056589-1.patch2.1 KBgun_dose

Comments

gun_dose created an issue. See original summary.

gun_dose’s picture

Issue summary: View changes
StatusFileSize
new2.1 KB

  • osman committed 676a389 on 8.x-2.x
    Issue #3056589: Add colorbox support
    
gun_dose’s picture

Something strange with commit credits ;)

osman’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.