Merge pull request #1102 from openclassify/dia

fix js error
This commit is contained in:
Muammer Top 2021-06-25 11:28:08 +03:00 committed by GitHub
commit c1c88217d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,9 +46,13 @@ $('.editInformationUser').on('click', function () {
var profile = response.data;
$('input[name="first_name"]').val(profile.first_name);
$('input[name="last_name"]').val(profile.last_name);
intlTelInput(document.querySelector("input[name='gsm_phone']")).setNumber(profile.gsm_phone);
intlTelInput(document.querySelector("input[name='office_phone']")).setNumber(profile.office_phone);
intlTelInput(document.querySelector("input[name='land_phone']")).setNumber(profile.land_phone);
const numbers = ['gsm_phone', 'office_phone', 'land_phone'];
for (let i = 0; i < numbers.length; i++) {
const number = numbers[i];
if (profile[number]) {
intlTelInput(document.querySelector(`input[name=${number}]`)).setNumber(profile[number]);
}
}
}
}
});