fix learn button
This commit is contained in:
@ -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';
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user