Created
March 28, 2022 05:40
-
-
Save AchalJ/9f128043bbcc024db639747c2c4ed1d5 to your computer and use it in GitHub Desktop.
WooPack Products Grid layout fix in PowerPack's Modal Box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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