minor fixes
This commit is contained in:
@ -124,12 +124,18 @@
|
||||
xhr.onload = () => {
|
||||
document.forms.download.querySelector('[type="submit"]').disabled = false;
|
||||
document.forms.download.querySelector('.submit-spinner').classList.add('submit-spinner_hide');
|
||||
if (xhr.status !== 200) {
|
||||
console.log(xhr.status);
|
||||
if (xhr.status !== 200 && xhr.status !== 201) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const response = xhr.response;
|
||||
result.innerHTML = xhr.response.result;
|
||||
result.href = xhr.response.result;
|
||||
console.log(response);
|
||||
if (xhr.status === 201) {
|
||||
sendReq()
|
||||
}
|
||||
}
|
||||
xhr.onerror = () => {
|
||||
document.forms.download.querySelector('[type="submit"]').disabled = false;
|
||||
@ -138,7 +144,8 @@
|
||||
document.forms.download.querySelector('[type="submit"]').disabled = true;
|
||||
document.forms.download.querySelector('.submit-spinner').classList.remove('submit-spinner_hide');
|
||||
xhr.send(new FormData(document.forms.download));
|
||||
sendReq()
|
||||
|
||||
|
||||
|
||||
}
|
||||
// при отправке формы
|
||||
|
Reference in New Issue
Block a user