3D FlipBook - Thumbnails hidden on ajax filter

l***n@gmail.com
2021-03-25
2021-03-27

Hi Ivan-

We're using 3D FlipBook along with the Divi Machine plugin to create a filterable archive of a compilation of PDF's.

We're running into one issue whenever we select a new filter category from the drop down - the thumbnails won't load unless the page is refreshed.

The Divi Machine dev team believes this is related to the initializing function when the page is loaded.

Any insight on how we can fix this?

https://www.loveyourrebellion.org/zine-archive/ password: look_at_me!

Thanks!

Replies

a***r@3dflipbook.net
2021-03-26
2021-03-26

ajax should care about the scripts localization and re-executing the scripts after rebuilding the page, but it cares only about html. For this plugin Ajax has to redefine client.min.js localization FB3D_CLIENT_LOCALE(wp_localize_script('3d-flip-book-client', 'FB3D_CLIENT_LOCALE',[...]);) and re-execute at least client.min.js, because its data changed.

l***n@gmail.com
2021-03-29
2021-03-29

Hi Ivan- Thanks for helping out with this. I passed on your suggestion to Divi Machine's team, and they came back with the following note/request: -- "I checked client.min.js file, but it was so huge and I couldn't find which one is start function. Because client.min.js and FB3D_CLIENT_LOCALE are loaded, so I think just re-call the start function of client.min.js after our ajax has been executed. Please contact 3D FlipBook to get start function of client.min.js" -- Let us know when you get a chance what we can pass back to their team. Cheers!

a***r@3dflipbook.net
2021-03-31
2021-03-31

they need to redefine FB3D_CLIENT_LOCALE with new data and execute client.min.js again.

l***n@gmail.com
2021-04-01
2021-04-01

Ivan, sorry to come back to this again, but the team wants to make sure they're redefining the localization in the correct place without breaking the code. Can you specify where within client.min.js this should go (if location doesn't matter, that would be good to know), and if there's anything in addition to the code you already provided that needs to be included? Thanks, Ivan.

a***r@3dflipbook.net
2021-04-05
2021-04-05

Update plugin to 1.10.22. now you need to update FB3D_CLIENT_LOCALE_ENCODED from the server for new pages and trigger event fb3d-init:

window.FB3D_CLIENT_LOCALE_ENCODED = {data: 'new b64 encoded data'};
jQuery(document).trigger('fb3d-init');

We added this event in 1.10.22 for you. Encoding was added for compatibility with wp rocket.

a***r@3dflipbook.net
2021-04-05
2021-04-05

FB3D_CLIENT_LOCALE_ENCODED is new script localization for client.min.js

Log In to leave a comment