From 971ea19763abb676277d0b212c5f7fa9c0fc4e87 Mon Sep 17 00:00:00 2001 From: Yann Gouffon Date: Thu, 22 Feb 2018 13:38:30 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=96=20bump=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc63162..d44582a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-toolbox", - "version": "2.0.8", + "version": "2.0.9", "description": "Yeoman generator", "homepage": "http://frontend.github.io/toolbox/", "author": { From c258439fa43f7a2982d1a0bab0e868153ba2ba06 Mon Sep 17 00:00:00 2001 From: Yann Gouffon Date: Fri, 9 Mar 2018 10:13:38 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20better=20script=20initializatio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generators/app/templates/assets/base.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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());