Skip to content

Instantly share code, notes, and snippets.

@keenthemes
Created November 21, 2022 14:37
Show Gist options
  • Save keenthemes/8adc844ac61d355c45b4454147e932e2 to your computer and use it in GitHub Desktop.
Save keenthemes/8adc844ac61d355c45b4454147e932e2 to your computer and use it in GitHub Desktop.
Place this file in resources/assets/core/js/components/_init.js
//
// Global init of core components
//
// Init components
var KTComponents = function () {
// Public methods
return {
init: function () {
KTApp.init();
KTDrawer.init();
KTMenu.init();
KTScroll.init();
KTSticky.init();
KTSwapper.init();
KTToggle.init();
KTScrolltop.init();
KTDialer.init();
KTImageInput.init();
KTPasswordMeter.init();
}
}
}();
// On document ready
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", function() {
KTComponents.init();
});
} else {
KTComponents.init();
}
// Init page loader
window.addEventListener("load", function() {
KTApp.initPageLoader();
});
// Declare KTApp for Webpack support
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
window.KTComponents = module.exports = KTComponents;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment