| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/components/com_community/assets/source/js/utils/ |
Upload File : |
(function( root, $, factory ) {
joms.util || (joms.util = {});
joms.util.photos = factory( root, $ );
})( window, joms.jQuery, function( window, $ ) {
var containers = [],
maxHeightThreshold = 180;
$( window ).resize( joms._.debounce(function() {
_rearrange();
}, 500 ));
function arrange( $ct ) {
var $children = $ct.children(),
width = $ct.width();
$children.css({
display: 'block',
'float': 'left',
margin: '1px 0',
overflow: 'hidden',
padding: 0,
position: 'relative'
}).each(function() {
var $el = $( this );
$el.data({
width: $el.width(),
height: $el.height()
});
});
_arrange( width, $children );
// Add to registered container.
containers.push( $ct );
}
function _arrange( ctWidth, $children ) {
var from = 0,
len = $children.length;
$children.each(function( index ) {
var divider, data, height, i;
divider = 0;
for ( i = from; i <= index; i++ ) {
data = $children.eq(i).data();
divider += data.width / data.height;
}
height = ctWidth / divider;
if ( height <= maxHeightThreshold ) {
for ( i = from; i <= index; i++ ) {
$children.eq( i ).find('img').css({ height: height });
}
from = index + 1;
} else if ( i === len ) {
for ( i = from; i <= len; i++ ) {
$children.eq( i ).nextAll().addBack()
.css({ height: maxHeightThreshold })
.find('img').css({ height: height });
}
}
});
// fix ff issue
$children.css('border', '1px solid transparent');
setTimeout(function() {
$children.css('border', '');
});
}
function _rearrange() {
var i, $ct;
for ( i = 0; i < containers.length; i++ ) {
$ct = containers[i];
_arrange( $ct.width(), $ct.children() );
}
}
// Exports.
return {
arrange: arrange
};
});