Merge pull request #8489 from raisedadead/fix/sign-in-buttons

Fix Sign in Buttons
This commit is contained in:
Berkeley Martinez
2016-05-06 14:14:51 -07:00

View File

@ -1,9 +1,9 @@
extends ../layout extends ../layout
block content block content
.text-center .text-center
h2 New to Free Code Camp? h2 New to Free Code Camp?
br br
.button-spacer .button-spacer
| Sign up now: | Sign up now:
a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signup') a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signup')
i.fa.fa-envelope i.fa.fa-envelope
@ -13,7 +13,7 @@ block content
| Sign up with GitHub | Sign up with GitHub
.spacer .spacer
hr hr
.spacer .spacer
h2 Are you a returning camper? h2 Are you a returning camper?
br br
.button-spacer .button-spacer
@ -41,7 +41,7 @@ block content
} }
$.each($(btnSelector), function(i, item) { $.each($(btnSelector), function(i, item) {
if ( if (
$(item).attr('href') === obj.methodLink && $(item).text() === obj.method &&
$(item).hasClass(obj.methodClass) $(item).hasClass(obj.methodClass)
) { ) {
$(item).addClass('active'); $(item).addClass('active');
@ -55,7 +55,11 @@ block content
var obj = {}; var obj = {};
$(this).removeClass('active'); $(this).removeClass('active');
obj.methodClass = $(this).attr('class').split(' ').pop(); obj.methodClass = $(this).attr('class').split(' ').pop();
obj.methodLink = $(this).attr('href'); obj.method = $(this).text();
localStorage.setItem('lastSigninMethod', JSON.stringify(obj)); if(obj.method === "Sign in with Email" || obj.method === "Sign in with GitHub") {
localStorage.setItem('lastSigninMethod', JSON.stringify(obj));
} else {
localStorage.removeItem('lastSigninMethod');
}
}); });
}); });