Issue #1836860 by attiks, durgesh_singh, Jelle_S, nod_, vks7056, Wim Leers: Picture doesn't work with AJAX callback
							parent
							
								
									cec8f5eb30
								
							
						
					
					
						commit
						3473bd5d3a
					
				| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
(function (Drupal) {
 | 
			
		||||
 | 
			
		||||
  "use strict";
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Call picturefill so newly added responsive images are processed.
 | 
			
		||||
   */
 | 
			
		||||
  Drupal.behaviors.responsiveImageAJAX = {
 | 
			
		||||
    attach: function () {
 | 
			
		||||
      if (window.picturefill) {
 | 
			
		||||
        window.picturefill();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
})(Drupal);
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
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';
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue