Skip to content
Snippets Groups Projects
Commit 3473bd5d authored by Alex Pott's avatar Alex Pott
Browse files

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
No related branches found
No related tags found
No related merge requests found
(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';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment