Ensure Functions.js completes before loading custom JS

6 replies · opened Mar 25, 2023

Rrezn8dMar 25, 2023

Updated to 7.0.4.
Patch notes now include a plugin.js but do not adequately explain use:

Option to choose JS Loading Type
plugins.js File to disable Async JS Loading

My custom JS relies on all plugins being fully loaded before running.

Is there a command to wait for function.js and/or plugins.js to fully load before running custom JS other than:


$(document).ready(function() {

I am using https://gohugo.io/ templating and this is my current JS load order:


    
    
    
    

I would prefer to only load functions.js and my custom js and allow functions.js to complete loading jquery, jquery cookie, and all other functions like masonry and isotope before running my custom js because I am adding some very complex coding to the website which will include loading Cesium JS WebGL mapping (See live URL) and use isotope for filtering maps.

SSemicolon WebSTAFFMar 26, 2023

Hello,

Apologies for the Inconveniences caused!

We are still updating Documentations as we speak and by next week most of the Documentations will be completed.

Consider checking the Updated Documentation here: https://docs.semicolonweb.com/docs/getting-started/javascript/ and let us know if you are facing any further issues.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Rrezn8dMar 27, 2023

Thank you. This was helpful however I am having an issue with lazy loading images in masonry/isotope and then creating a Lightbox gallery on that gallery.

I changed the load order per your updated documentation:

The plugins.js is configured like this:


  jsFolder:"/theme/7.0.4/js/",
  cssFolder:"/theme/7.0.4/css/",
  jsLoadType:"fn"

The Lightbox worked perfectly in version 6.5.5, however in version 7.0.4 I cannot get magnificpopup to work and I have tried everything. Please compare these pages and tell me what is going wrong.

version 6.5.5
https://weathermodificationhistory.com/newspapers/
version 7.0.4
https://wip.rednet.solutions/newspapers/

version 6.5.5
https://weathermodificationhistory.com/operation-popeye-motorpool-intermediary-compatriot-weather-warfare-vietnam/#media
version 7.0.4
https://wip.rednet.solutions/operation-popeye-motorpool-intermediary-compatriot-weather-warfare-vietnam/#media

SSemicolon WebSTAFFMar 27, 2023

Hello,

Thanks for your Patience!

We confirm the issue with Lightbox on your Page. We are working on fixing this issue and will get back to you shortly with a solution. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

SSemicolon WebSTAFFMar 27, 2023

Hello,

Thanks for your Kind Patience!

Find the following code in the js/plugins.js File:
[ch_pre type="js"]delegate:e.hasClass("grid-container-filterable")?'a.grid-lightbox-filtered[data-lightbox="gallery-item"]':'a[data-lightbox="gallery-item"]'[/ch_pre]

and replace it with:
[ch_pre type="js"]delegate:'a[data-lightbox="gallery-item"]'[/ch_pre]

This will definitely fix the issue. We will release this code in the update by this week. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SSemicolon WebSTAFFMar 28, 2023

Hello,

Apologies. Not sure how we missed including the Magazine Template fix in the last update but yes we ensure you that this will be included in the next update. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard