Commit efa75785 authored by osman's avatar osman

Fixed indentation.

parent 0bd568ee
......@@ -41,26 +41,26 @@ function lazy_preprocess_field(&$variables) {
$config = \Drupal::config('lazy.settings')->get();
$pages = $config['disabled_paths'];
$path_matches = lazy_disabled_by_path($pages);
if (!$path_matches) {
$entity = $element['#object'];
$entity_type = $entity->getEntityTypeId();
$bundle = $entity->bundle();
$view_mode = $element['#view_mode'];
$field_name = $element['#field_name'];
$render_display = EntityViewDisplay::collectRenderDisplay($entity, $view_mode);
$field_display = $render_display->getComponent($field_name);
$image_fields = [];
if (isset($field_display['third_party_settings']['lazy']) && $field_display['third_party_settings']['lazy']['lazy_image']) {
foreach ($variables['items'] as $key => $item) {
$variables['items'][$key]['content']['#item_attributes']['data-lazy-load-fields'] = 'image';
$view_mode = ($view_mode === 'full') ? 'default' : $view_mode;
$image_fields["$entity_type--$bundle--$view_mode--$field_name"] = TRUE;
if (!$path_matches) {
$entity = $element['#object'];
$entity_type = $entity->getEntityTypeId();
$bundle = $entity->bundle();
$view_mode = $element['#view_mode'];
$field_name = $element['#field_name'];
$render_display = EntityViewDisplay::collectRenderDisplay($entity, $view_mode);
$field_display = $render_display->getComponent($field_name);
$image_fields = [];
if (isset($field_display['third_party_settings']['lazy']) && $field_display['third_party_settings']['lazy']['lazy_image']) {
foreach ($variables['items'] as $key => $item) {
$variables['items'][$key]['content']['#item_attributes']['data-lazy-load-fields'] = 'image';
$view_mode = ($view_mode === 'full') ? 'default' : $view_mode;
$image_fields["$entity_type--$bundle--$view_mode--$field_name"] = TRUE;
}
}
}
lazy_settings_update($image_fields);
}
lazy_settings_update($image_fields);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment