1var UM = window.UM || {}; 2 3(function ($) { 4 function _isNotTaglibImgFilter() { 5 return !$(this).parent().hasClass('taglib-icon'); 6 } 7 8 function _initSingleImgNormalizer($imgContainer) { 9 var $images = $imgContainer.find('img'); 10 var minHeight = 9999; 11 12 $images = $images.filter(_isNotTaglibImgFilter); 13 14 $images.each(function () { 15 var $img = $(this); 16 var imgHeight = $img.height(); 17 18 if (imgHeight < minHeight) { 19 minHeight = imgHeight; 20 } 21 }); 22 23 // Si no han cargado las imágenes, esperamos. Usamos 20 porque sino con Firefox no se ven bien. 24 if (minHeight > 20) { 25 $images.height(minHeight); 26 } else { 27 // Llamamos de nuevo a la función tras un tiempo de espera si las imágenes no han cargado aún 28 minHeight = 9999; 29 setTimeout(_initSingleImgNormalizer.bind(null, $imgContainer), 200); 30 } 31 } 32 33 function _initAllImgNormalizer($imgContainers) { 34 $imgContainers.each(function () { 35 _initSingleImgNormalizer($(this)); 36 }); 37 } 38 39 function _init() { 40 var $imgContainer = $('.img-normalizer'); 41 var length = $imgContainer.length; 42 43 if (length === 1) { 44 _initSingleImgNormalizer($imgContainer); 45 } else if (length > 1) { 46 _initAllImgNormalizer($imgContainer); 47 } 48 } 49 50 UM.ImgNormalizer = { 51 init: _init, 52 normalize: _initSingleImgNormalizer 53 }; 54}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.