I'm currently running a compiled scripts.js file that activates a bunch of various UI capabilities (masonry, navbar, etc.) using the onRendered method.
Template.mainLayout.onRendered( function() {
$.getScript('js/scripts.js');
});
My issue is, if I navigate to another page like /team, the script doesn't rerun, meaning in other pages, the masonry does not work anymore. Additionally, when I come back to the home page, the script also breaks, making the nav bar broken.
Please let me know if I'm using this function wrong?
mainLayoutin iron router?