diff --git a/server/views/partials/navbar.jade b/server/views/partials/navbar.jade index 6a51f98145..7108bd05b4 100644 --- a/server/views/partials/navbar.jade +++ b/server/views/partials/navbar.jade @@ -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'; + }); + });