fix 16.11
This commit is contained in:
@@ -173,9 +173,6 @@ function remoteControl(main, button) {
|
||||
subject = document.querySelector(`.${subjectClass}`),
|
||||
buttons = Array.from(main.querySelectorAll(button));
|
||||
|
||||
console.log(main);
|
||||
|
||||
|
||||
main.addEventListener('click', function (eventMain) {
|
||||
setTimeout(() => {
|
||||
let indexActive = buttons.findIndex((button, index) => {
|
||||
@@ -194,18 +191,52 @@ function remoteControl(main, button) {
|
||||
})
|
||||
}
|
||||
|
||||
// formCheck('.modal-form__content', 'input[type=submit]');
|
||||
// formCheck('.modal-map__form', 'input[type=submit]');
|
||||
formCheck('.modal-form__content', 'input[type=submit]');
|
||||
formCheck('.modal-map__form', 'input[type=submit]');
|
||||
|
||||
// function formCheck(form, submit) {
|
||||
// let forms = document.querySelectorAll(form);
|
||||
function formCheck(form, submit) {
|
||||
let forms = document.querySelectorAll(form);
|
||||
|
||||
// forms.forEach(form => {
|
||||
// let thisSubmit = form.querySelector(submit);
|
||||
forms.forEach(form => {
|
||||
let thisSubmit = form.querySelector(submit);
|
||||
|
||||
// thisSubmit.onclick = function () {
|
||||
// form.classList.add('check')
|
||||
// }
|
||||
thisSubmit.onclick = function () {
|
||||
form.classList.add('check')
|
||||
}
|
||||
|
||||
// })
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
inputPhoneNoFlag('.no-flag');
|
||||
|
||||
function inputPhoneNoFlag(input){
|
||||
let inputs = document.querySelectorAll(input);
|
||||
|
||||
inputs.forEach(input => {
|
||||
let code = '+' + input.dataset.code;
|
||||
|
||||
input.onfocus = function () {
|
||||
if (input.value == '') {
|
||||
input.value = code;
|
||||
}
|
||||
}
|
||||
|
||||
input.addEventListener('input', function(event) {
|
||||
let text = event.target.value;
|
||||
let length = text.length;
|
||||
let newSymbol = event.data;
|
||||
|
||||
if (isNaN(event.data) || event.data == ' ') {
|
||||
event.target.value = text.slice(0, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (length == 3 || length == 7 || length == 11) {
|
||||
if (newSymbol != null) {
|
||||
event.target.value = text.slice(0, -1) + ' ' + newSymbol;
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user