From 6f89d30b379415d313deaf01b67cf93839d47996 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Mon, 13 Aug 2018 10:50:23 +0530 Subject: [PATCH] commento.js: remove social buttons on login button --- frontend/js/commento.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 462f842..082c8ac 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -67,6 +67,7 @@ var shownReply = {}; var configuredOauths = []; var loginBoxType = "signup"; + var oauthButtonsShown = false; function $(id) { @@ -1079,7 +1080,10 @@ append(loginBox, oauthPretext); append(oauthButtonsContainer, oauthButtons); append(loginBox, oauthButtonsContainer); + oauthButtonsShown = true; } + else + oauthButtonsShown = false; append(loginBox, close); @@ -1105,10 +1109,11 @@ loginBoxType = "login"; - if (leaveOauth !== true && configuredOauths.length > 0) { + if (ouathButtonsShown && leaveOauth !== true && configuredOauths.length > 0) { remove(hr); remove(oauthPretext); remove(oauthButtonsContainer); + oauthButtonsShown = false; } } @@ -1183,7 +1188,7 @@ remove(emailButton); remove(loginLinkContainer); - if (loginBoxType == "signup") { + if (oauthButtonsShown) { if (configuredOauths.length > 0) { remove(hr); remove(oauthPretext); @@ -1289,7 +1294,7 @@ } - global.loginBoxShow = function() { + global.loginBoxShow = function(signup) { var mainArea = $(ID_MAIN_AREA); var loginBoxContainer = $(ID_LOGIN_BOX_CONTAINER);