Coding style updates.
This commit is contained in:
Родитель
08f3dea871
Коммит
aa35670c2d
|
@ -52,7 +52,9 @@
|
||||||
// new submission, clear old errors
|
// new submission, clear old errors
|
||||||
errorArray = [];
|
errorArray = [];
|
||||||
newsletterErrors.style.display = 'none';
|
newsletterErrors.style.display = 'none';
|
||||||
while (newsletterErrors.firstChild) newsletterErrors.removeChild(newsletterErrors.firstChild);
|
while (newsletterErrors.firstChild) {
|
||||||
|
newsletterErrors.removeChild(newsletterErrors.firstChild);
|
||||||
|
}
|
||||||
|
|
||||||
var fmt = document.getElementById('fmt').value;
|
var fmt = document.getElementById('fmt').value;
|
||||||
var email = document.getElementById('email').value;
|
var email = document.getElementById('email').value;
|
||||||
|
@ -69,7 +71,7 @@
|
||||||
xhr.onload = function(r) {
|
xhr.onload = function(r) {
|
||||||
if (r.target.status >= 200 && r.target.status < 300) {
|
if (r.target.status >= 200 && r.target.status < 300) {
|
||||||
// response is null if handled by service worker
|
// response is null if handled by service worker
|
||||||
if(response === null ) {
|
if(response === null) {
|
||||||
newsletterError(new Error());
|
newsletterError(new Error());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -77,8 +79,7 @@
|
||||||
if (response.success === true) {
|
if (response.success === true) {
|
||||||
newsletterForm.style.display = 'none';
|
newsletterForm.style.display = 'none';
|
||||||
newsletterThanks();
|
newsletterThanks();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if(response.errors) {
|
if(response.errors) {
|
||||||
for (var i = 0; i < response.errors.length; i++) {
|
for (var i = 0; i < response.errors.length; i++) {
|
||||||
errorArray.push(response.errors[i]);
|
errorArray.push(response.errors[i]);
|
||||||
|
@ -86,8 +87,7 @@
|
||||||
}
|
}
|
||||||
newsletterError(new Error());
|
newsletterError(new Error());
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
newsletterError(new Error());
|
newsletterError(new Error());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче