-- HikaShop version -- : 3.1.1
When using the data-consistencyheight option to ensure that all Product/Category divs all had the same height I noticed that there was excess white space added below content.
Modifying setConsistencyHeight so that padding is take into account appears to fix this issue.
setConsistencyHeight: function(elems, mode) {
if(!elems || !elems.length || elems.length == 0)
return;
var maxHeight = 0, cpt = 0;
for(var i = elems.length - 1; i >= 0; i--) {
var styles = window.getComputedStyle(elems[i]);
var padding = parseFloat(styles.paddingTop) +
parseFloat(styles.paddingBottom);
if(maxHeight > 0 && elems[i].clientHeight - padding < maxHeight) {
cpt++;
} else if(elems[i].clientHeight - padding > maxHeight) {
maxHeight = elems[i].clientHeight - padding;
console.log(elems[i]);
cpt++;
}
}
if(cpt <= 1)
return;
for(var i = elems.length - 1; i >= 0; i--) {
if(mode !== undefined && mode == 'min')
elems[i].style.minHeight = maxHeight + 'px';
else
elems[i].style.height = maxHeight + 'px';
}