This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

JS function to re-sort the results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support JS function to re-sort the results

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #56602
    milena_u6jmmilena_u6jm
    Participant

    Hey Ernest & team.

    We have set up some custom JS to take over from the normal when you click a result. This is working as expect, it opens a custom lightbox modal.

    Our issue is, that when you close the custom modal, using the “Back to results” button, the results grid is now in a single column, not the isotopic view that it previously was. How can we stop this from happening, we cant work out why this change is occuring.

    Please let us know, thanks

    Seamus

    #56621
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Seamus,

    This one is a very tough one, but I think I see the problem. As far as I can tell, you are trying to reatain the results opened, when the user closes the modal via the “Back to Results” button. However there is a setting for that here. When that option is turned off, the results will not close whenever the user clicks away from the container.

    Therefore you can simplify the closeModal function like so:

    
            function closeModal() {
                const $modal = $('#artwork-zoom-modal');
                $modal.attr('data-stage', '1');
                $modal.css('display', 'none');
                $('.artwork-modal-bg-stage1, .artwork-modal-bg-stage2').addClass('hidden').css('display', 'none');
                $('.artwork-modal-stage1, .artwork-modal-stage2').addClass('hidden').css('display', 'none');
                $('body').removeClass('modal-open overflow-hidden');
            }
    

    I’m almost a 100% sure that this is going to fix the issue, as the visibility was all over the place in the original closeModal function, which caused the problem with the isotope recalculation.

    #56631
    milena_u6jmmilena_u6jm
    Participant

    Thanks my friend, that one is resolved by adding those two fixes. Love your work!

    #56642
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.