Wrap a wait before the DOM is loaded before loading anything calling anything in app.js

This commit is contained in:
johnnyq
2025-03-23 18:08:14 -04:00
parent 53713a0318
commit df8a755462
+5
View File
@@ -1,3 +1,4 @@
$(document).ready(function() {
//Prevents resubmit on forms //Prevents resubmit on forms
if(window.history.replaceState){ if(window.history.replaceState){
window.history.replaceState(null, null, window.location.href); window.history.replaceState(null, null, window.location.href);
@@ -441,8 +442,10 @@ $(function () {
// Data Tables // Data Tables
new DataTable('.dataTables'); new DataTable('.dataTables');
// Initialize International Phone Input // Initialize International Phone Input
const inputs = document.querySelectorAll('input[type="tel"]'); const inputs = document.querySelectorAll('input[type="tel"]');
// Loop through all the selected inputs and initialize intlTelInput on each one // Loop through all the selected inputs and initialize intlTelInput on each one
inputs.forEach(input => { inputs.forEach(input => {
window.intlTelInput(input, { window.intlTelInput(input, {
@@ -451,3 +454,5 @@ inputs.forEach(input => {
loadUtils: () => import("../plugins/intl-tel-input/js/utils.js") // for formatting/placeholders etc loadUtils: () => import("../plugins/intl-tel-input/js/utils.js") // for formatting/placeholders etc
}); });
}); });
});