Search Spring - After Result Change Psuedo Example
var conformResults = {
id: 0,
init: function(){
var _self = this;
window.clearTimeout( _self.id );
_self.id = setTimeout(function(){
conformResults.conform('.product-tile--grid .product-tile');
}, 500);
},
conform: function(selector) {
var maxHeight = 0;
$(selector).removeAttr("style").each(function() {
var $this = $(this);
if ( $this.outerHeight() > maxHeight ) {
maxHeight = $this.outerHeight();
}
}).css("height", maxHeight + "px");
return this;
}
};
$(document).on('SearchSpring_AfterResultsChange', function(){
// console.log('SearchSpring_AfterResultsChange');
conformResults.init();
$('.product-tile--grid').find('img').on('load', function(){
// console.log('image loaded');
conformResults.init()
});
});
$( window ).on( 'resize', conformResults.init );
afterResultsChange: function() {
$(document).trigger('SearchSpring_AfterResultsChange');
}