function ResponsiveImageHooks::libraryInfoAlter

Implements hook_library_info_alter().

Load responsive_image.js whenever ajax is added.

File

core/modules/responsive_image/src/Hook/ResponsiveImageHooks.php, line 101

Class

ResponsiveImageHooks
Hook implementations for responsive_image.

Namespace

Drupal\responsive_image\Hook

Code

public function libraryInfoAlter(array &$libraries, $module) {
    if ($module === 'core' && isset($libraries['drupal.ajax'])) {
        $libraries['drupal.ajax']['dependencies'][] = 'responsive_image/ajax';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.