Created
November 21, 2022 14:37
-
-
Save keenthemes/8adc844ac61d355c45b4454147e932e2 to your computer and use it in GitHub Desktop.
Place this file in resources/assets/core/js/components/_init.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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