Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
✨ better script initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Yago committed Mar 9, 2018
1 parent 971ea19 commit c258439
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions generators/app/templates/assets/base.js
Original file line number Diff line number Diff line change
@@ -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());

0 comments on commit c258439

Please sign in to comment.