diff --git a/generators/app/templates/assets/base.js b/generators/app/templates/assets/base.js index 17e785f..f661f06 100644 --- a/generators/app/templates/assets/base.js +++ b/generators/app/templates/assets/base.js @@ -1,12 +1,17 @@ +/* globals jQuery, document */ + // You will use that file to import all your scripts // Ex: import gallery from './gallery'<% if (svgIcons) { %> import svgIcons from '../icons/svg-icons'; svgIcons(); // Must run as soon as possible<% } %> +const init = () => { + // Run your imported scripts + // Ex: gallery(); +}; + (function ($) { - $(document).ready(function () { - // Run your imported scripts - // Ex: gallery(); - }); + $(document).ready(() => init()); })(jQuery); +document.addEventListener('ToolboxReady', () => init());