Commit 3473bd5d authored by alexpott's avatar alexpott

Issue #1836860 by attiks, durgesh_singh, Jelle_S, nod_, vks7056, Wim Leers:...

Issue #1836860 by attiks, durgesh_singh, Jelle_S, nod_, vks7056, Wim Leers: Picture doesn't work with AJAX callback
parent cec8f5eb
(function (Drupal) {
"use strict";
/**
* Call picturefill so newly added responsive images are processed.
*/
Drupal.behaviors.responsiveImageAJAX = {
attach: function () {
if (window.picturefill) {
window.picturefill();
}
}
};
})(Drupal);
ajax:
version: VERSION
js:
js/responsive_image.ajax.js: {}
......@@ -475,3 +475,14 @@ function _responsive_image_image_style_url($style_name, $path) {
}
return file_create_url($path);
}
/**
* Implements hook_library_info_alter().
*
* Load responsive_image.js whenever ajax is added.
*/
function responsive_image_library_info_alter(array &$libraries, $module) {
if ($module === 'core' && isset($libraries['drupal.ajax'])) {
$libraries['drupal.ajax']['dependencies'][] = 'responsive_image/ajax';
}
}
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