Skip to content

Commit 8b69758

Browse files
committed
Update
1 parent df5cbb7 commit 8b69758

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

feedback/form-processing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// проверять ли капчу
2626
define('HAS_CHECK_CAPTCHA', true);
2727
// обязательно ли наличие файлов, прикреплённых к форме
28-
define('HAS_ATTACH_REQUIRED', true);
28+
define('HAS_ATTACH_REQUIRED', false);
2929
// разрешённые mime типы файлов
3030
define('ALLOWED_MIME_TYPES', ['image/jpeg', 'image/gif', 'image/png']);
3131
// максимально-допустимый размер файла

feedback/js/form-processing.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,11 @@ class ItcSubmitForm {
118118

119119
// при получении успешного ответа от сервера
120120
_successXHR(data) {
121-
122-
/*const elProgress = this._elForm.querySelector('.progress');
123-
if (elProgress) {
124-
elProgress.classList.add('d-none');
125-
const elProgressBar = elProgress.querySelector('.progress-bar');
126-
elProgressBar.setAttribute('aria-valuenow', '0');
127-
elProgressBar.style.width = '0';
128-
}*/
129-
130121
const elAttach = this._elForm.querySelector('.form-attach');
131122
if (elAttach) {
132123
elAttach.classList.remove('is-invalid');
133124
elAttach.querySelector('.invalid-feedback').textContent = '';
134125
}
135-
136126
this._elForm.querySelectorAll('input, textarea').forEach(el => {
137127
this._setStateValidaion(el);
138128
});
@@ -193,9 +183,7 @@ class ItcSubmitForm {
193183

194184
// отправка формы
195185
_onSubmit() {
196-
197186
this._elForm.dispatchEvent(new Event('before-send'));
198-
199187
if (this._isCheckValidationOnClient) {
200188
if (!this._checkValidity()) {
201189
const elInvalid = this._elForm.querySelector('.is-invalid');
@@ -234,15 +222,6 @@ class ItcSubmitForm {
234222
this._errorXHR();
235223
}
236224
}
237-
/*this._elForm.querySelector('.progress').classList.remove('d-none');
238-
xhr.upload.onprogress = (e) => {
239-
if (e.lengthComputable) {
240-
const value = ((e.loaded * 100) / e.total).toFixed(1);
241-
const el = this._elForm.querySelector('.progress-bar');
242-
el.setAttribute('aria-valuenow', value);
243-
el.style.width = value + '%';
244-
}
245-
}*/
246225
xhr.send(this._getFormData());
247226
};
248227

@@ -327,10 +306,5 @@ class ItcSubmitForm {
327306
this._elForm.querySelector('.is-invalid').classList.remove('is-invalid');
328307
}
329308
}
330-
/*if (this._elForm.querySelector('.form-progress')) {
331-
const elProgressBar = this._elForm.querySelector('.progress-bar');
332-
elProgressBar.setAttribute('aria-valuenow', '0');
333-
elProgressBar.style.width = 0;
334-
}*/
335309
}
336310
}

0 commit comments

Comments
 (0)