Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
itchief committed Jun 19, 2022
1 parent df5cbb7 commit 8b69758
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
2 changes: 1 addition & 1 deletion feedback/form-processing.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// проверять ли капчу
define('HAS_CHECK_CAPTCHA', true);
// обязательно ли наличие файлов, прикреплённых к форме
define('HAS_ATTACH_REQUIRED', true);
define('HAS_ATTACH_REQUIRED', false);
// разрешённые mime типы файлов
define('ALLOWED_MIME_TYPES', ['image/jpeg', 'image/gif', 'image/png']);
// максимально-допустимый размер файла
Expand Down
26 changes: 0 additions & 26 deletions feedback/js/form-processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,11 @@ class ItcSubmitForm {

// при получении успешного ответа от сервера
_successXHR(data) {

/*const elProgress = this._elForm.querySelector('.progress');
if (elProgress) {
elProgress.classList.add('d-none');
const elProgressBar = elProgress.querySelector('.progress-bar');
elProgressBar.setAttribute('aria-valuenow', '0');
elProgressBar.style.width = '0';
}*/

const elAttach = this._elForm.querySelector('.form-attach');
if (elAttach) {
elAttach.classList.remove('is-invalid');
elAttach.querySelector('.invalid-feedback').textContent = '';
}

this._elForm.querySelectorAll('input, textarea').forEach(el => {
this._setStateValidaion(el);
});
Expand Down Expand Up @@ -193,9 +183,7 @@ class ItcSubmitForm {

// отправка формы
_onSubmit() {

this._elForm.dispatchEvent(new Event('before-send'));

if (this._isCheckValidationOnClient) {
if (!this._checkValidity()) {
const elInvalid = this._elForm.querySelector('.is-invalid');
Expand Down Expand Up @@ -234,15 +222,6 @@ class ItcSubmitForm {
this._errorXHR();
}
}
/*this._elForm.querySelector('.progress').classList.remove('d-none');
xhr.upload.onprogress = (e) => {
if (e.lengthComputable) {
const value = ((e.loaded * 100) / e.total).toFixed(1);
const el = this._elForm.querySelector('.progress-bar');
el.setAttribute('aria-valuenow', value);
el.style.width = value + '%';
}
}*/
xhr.send(this._getFormData());
};

Expand Down Expand Up @@ -327,10 +306,5 @@ class ItcSubmitForm {
this._elForm.querySelector('.is-invalid').classList.remove('is-invalid');
}
}
/*if (this._elForm.querySelector('.form-progress')) {
const elProgressBar = this._elForm.querySelector('.progress-bar');
elProgressBar.setAttribute('aria-valuenow', '0');
elProgressBar.style.width = 0;
}*/
}
}

0 comments on commit 8b69758

Please sign in to comment.