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 32f15e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 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();
}
});
});
9 changes: 5 additions & 4 deletions src/static/styles/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1453,15 +1453,16 @@ textarea {
}
}

.auth-quick-links, .lang-quick-links {
.auth-quick-links,
.lang-quick-links {
position: relative;
margin: 3px;
}

.auth-quick-links {
.nick {
border-radius: 0;
border: none;
border: 0;

a {
display: block;
Expand All @@ -1471,7 +1472,7 @@ textarea {

.lang-quick-links {
border-radius: 0;
border: none;
border: 0;
text-align: center;

ul {
Expand All @@ -1484,7 +1485,7 @@ textarea {
margin: 4px;

&:before {
content: "";
content: '';
}
}
}
Expand Down

0 comments on commit 32f15e3

Please sign in to comment.