fix learn button

This commit is contained in:
Quincy Larson
2015-10-07 02:35:23 -07:00
parent 0f6cdf8be1
commit 066b2ac7f9

View File

@ -27,3 +27,19 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
.hidden-xs.hidden-sm
a(href='/' + user.username)
img.profile-picture.float-right(src='#{user.picture}')
script.
$(document).ready(function() {
$('.learn-btn').click(function(e) {
var challengeDashedName = null;
e.preventDefault();
if (typeof dashedName === "string") {
return location.reload();
}
if (typeof localStorage !== 'undefined') {
challengeDashedName = localStorage.getItem('currentDashedName');
}
window.location = challengeDashedName ?
'/challenges/' + challengeDashedName :
'/map';
});
});