Loading lazy.module +3 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Field\FormatterInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Template\AttributeHelper; use Drupal\Core\Url; use Drupal\image\Entity\ImageStyle; use Drupal\file\Entity\File; Loading Loading @@ -239,7 +240,7 @@ function lazy_process_variables(array &$variables) { * Implements template_preprocess_image(). */ function lazy_preprocess_image(&$variables) { if (array_key_exists('data-lazy', $variables['attributes'])) { if (AttributeHelper::attributeExists('data-lazy', $variables['attributes'])) { lazy_process_variables($variables); // We don't need `data-lazy` attribute anymore. unset($variables['attributes']['data-lazy']); Loading @@ -250,7 +251,7 @@ function lazy_preprocess_image(&$variables) { * Implements template_preprocess_responsive_image(). */ function lazy_preprocess_responsive_image(&$variables) { if (array_key_exists('data-lazy', $variables['attributes'])) { if (AttributeHelper::attributeExists('data-lazy', $variables['attributes'])) { // The `data-lazy` attribute will be removed in `lazy_preprocess_image()`. $lazy_service = \Drupal::service('lazy'); $config = $lazy_service->getSettings(); Loading Loading
lazy.module +3 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Field\FormatterInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Template\AttributeHelper; use Drupal\Core\Url; use Drupal\image\Entity\ImageStyle; use Drupal\file\Entity\File; Loading Loading @@ -239,7 +240,7 @@ function lazy_process_variables(array &$variables) { * Implements template_preprocess_image(). */ function lazy_preprocess_image(&$variables) { if (array_key_exists('data-lazy', $variables['attributes'])) { if (AttributeHelper::attributeExists('data-lazy', $variables['attributes'])) { lazy_process_variables($variables); // We don't need `data-lazy` attribute anymore. unset($variables['attributes']['data-lazy']); Loading @@ -250,7 +251,7 @@ function lazy_preprocess_image(&$variables) { * Implements template_preprocess_responsive_image(). */ function lazy_preprocess_responsive_image(&$variables) { if (array_key_exists('data-lazy', $variables['attributes'])) { if (AttributeHelper::attributeExists('data-lazy', $variables['attributes'])) { // The `data-lazy` attribute will be removed in `lazy_preprocess_image()`. $lazy_service = \Drupal::service('lazy'); $config = $lazy_service->getSettings(); Loading