Skip to content

Commit

Permalink
Close nav on back
Browse files Browse the repository at this point in the history
  • Loading branch information
nisargjhaveri committed Feb 1, 2016
1 parent 6827cc4 commit eb7904b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/static/scripts/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,12 @@ $(function () {
$(function() {
function openPrimaryNavSidebar() {
$('.primary-nav-wrap').addClass('open');
location.hash = 'nav';
}

function closePrimaryNavSidebar() {
$('.primary-nav-wrap').removeClass('open');
location.hash = '_';
}

$('.primary-nav-overlay').on('click', closePrimaryNavSidebar);
Expand All @@ -342,12 +344,21 @@ $(function() {
return;
}
$('.quick-links-wrap').addClass('open');
location.hash = 'nav';
}

function closeQuickLinksSidebar() {
$('.quick-links-wrap').removeClass('open');
location.hash = '_';
}

$('.quick-links-overlay').on('click', closeQuickLinksSidebar);
$('.quick-links-open').on('click', openQuickLinksSidebar);

$(window).on('hashchange', function() {
if (location.hash != '#nav') {
closePrimaryNavSidebar();
closeQuickLinksSidebar();
}
});
});

0 comments on commit eb7904b

Please sign in to comment.