Skip to content

Instantly share code, notes, and snippets.

@AchalJ
Created March 28, 2022 05:40
Show Gist options
  • Select an option

  • Save AchalJ/9f128043bbcc024db639747c2c4ed1d5 to your computer and use it in GitHub Desktop.

Select an option

Save AchalJ/9f128043bbcc024db639747c2c4ed1d5 to your computer and use it in GitHub Desktop.
WooPack Products Grid layout fix in PowerPack's Modal Box
(function($) {
$(document).on('pp_modal_box_rendered', function(e, $scope) {
if ( $scope.find( '.woopack-products-grid-wrap' ).length > 0 ) {
$scope.find( '.woopack-products-grid-wrap' ).each(function() {
var nodeId = $(this).closest('.fl-module').attr('data-node');
if ( 'undefined' !== typeof window['woopack_' + nodeId] ) {
var obj = window['woopack_' + nodeId];
if ( ! obj.masonry ) {
obj._gridLayoutMatchHeight();
}
if ( obj.filters || obj.masonry ) {
if ( $scope.find('ul.products').data( 'isotope' ) ) {
$scope.find('ul.products').isotope('layout');
} else {
obj._gridLayout();
}
}
setTimeout(function() {
obj._initSlider();
}, 500);
}
});
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment