From 090c5b8b18d7b3c2ad6e81c6e5e83730611bd60a Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Sat, 7 May 2016 00:27:49 +0530 Subject: [PATCH] Fix Sign in Buttons --- server/views/account/signin.jade | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/server/views/account/signin.jade b/server/views/account/signin.jade index 9ce4163c12..c6be91453d 100644 --- a/server/views/account/signin.jade +++ b/server/views/account/signin.jade @@ -1,9 +1,9 @@ extends ../layout block content .text-center - h2 New to Free Code Camp? + h2 New to Free Code Camp? br - .button-spacer + .button-spacer | Sign up now: a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signup') i.fa.fa-envelope @@ -13,7 +13,7 @@ block content | Sign up with GitHub .spacer hr - .spacer + .spacer h2 Are you a returning camper? br .button-spacer @@ -41,7 +41,7 @@ block content } $.each($(btnSelector), function(i, item) { if ( - $(item).attr('href') === obj.methodLink && + $(item).text() === obj.method && $(item).hasClass(obj.methodClass) ) { $(item).addClass('active'); @@ -55,7 +55,11 @@ block content var obj = {}; $(this).removeClass('active'); obj.methodClass = $(this).attr('class').split(' ').pop(); - obj.methodLink = $(this).attr('href'); - localStorage.setItem('lastSigninMethod', JSON.stringify(obj)); + obj.method = $(this).text(); + if(obj.method === "Sign in with Email" || obj.method === "Sign in with GitHub") { + localStorage.setItem('lastSigninMethod', JSON.stringify(obj)); + } else { + localStorage.removeItem('lastSigninMethod'); + } }); });