commento.js: hide error div if no error reported

This commit is contained in:
Adhityaa Chandrasekar 2019-04-13 21:34:27 -04:00
parent 86393ad9ab
commit 7e9b3e5b26

View File

@ -354,6 +354,8 @@
if (!resp.success) { if (!resp.success) {
errorShow(resp.message); errorShow(resp.message);
return; return;
} else {
errorHide();
} }
requireIdentification = resp.requireIdentification; requireIdentification = resp.requireIdentification;
@ -381,6 +383,13 @@
} }
function errorHide() {
var el = $(ID_ERROR);
attrSet(el, "style", "display: none;");
}
function errorElementCreate() { function errorElementCreate() {
var el = create("div"); var el = create("div");
@ -527,6 +536,8 @@
if (!resp.success) { if (!resp.success) {
errorShow(resp.message); errorShow(resp.message);
return; return;
} else {
errorHide();
} }
var message = ""; var message = "";
@ -886,6 +897,8 @@
if (!resp.success) { if (!resp.success) {
errorShow(resp.message); errorShow(resp.message);
return return
} else {
errorHide();
} }
var card = $(ID_CARD + commentHex); var card = $(ID_CARD + commentHex);
@ -909,6 +922,8 @@
if (!resp.success) { if (!resp.success) {
errorShow(resp.message); errorShow(resp.message);
return return
} else {
errorHide();
} }
var card = $(ID_CARD + commentHex); var card = $(ID_CARD + commentHex);
@ -982,6 +997,8 @@
score.innerText = scorify(parseInt(score.innerText.replace(/[^\d-.]/g, "")) - newDirection + oldDirection); score.innerText = scorify(parseInt(score.innerText.replace(/[^\d-.]/g, "")) - newDirection + oldDirection);
upDownOnclickSet(upvote, downvote, commentHex, oldDirection); upDownOnclickSet(upvote, downvote, commentHex, oldDirection);
return; return;
} else {
errorHide();
} }
}); });
} }
@ -1135,6 +1152,8 @@
if (!resp.success) { if (!resp.success) {
errorShow(resp.message); errorShow(resp.message);
return; return;
} else {
errorHide();
} }
cookieSet("commentoCommenterToken", resp.commenterToken); cookieSet("commentoCommenterToken", resp.commenterToken);
@ -1303,6 +1322,8 @@
global.loginBoxClose(); global.loginBoxClose();
errorShow(resp.message); errorShow(resp.message);
return return
} else {
errorHide();
} }
cookieSet("commentoCommenterToken", resp.commenterToken); cookieSet("commentoCommenterToken", resp.commenterToken);
@ -1348,6 +1369,8 @@
global.loginBoxClose(); global.loginBoxClose();
errorShow(resp.message); errorShow(resp.message);
return return
} else {
errorHide();
} }
loginUP(email.value, password.value, id); loginUP(email.value, password.value, id);
@ -1454,6 +1477,8 @@
if (!resp.success) { if (!resp.success) {
errorShow(resp.message); errorShow(resp.message);
return return
} else {
errorHide();
} }
call(callback); call(callback);