Skip to content

Commit

Permalink
Fix active for navbar with same filename in different folder
Browse files Browse the repository at this point in the history
* Fixes #49
  • Loading branch information
Dynalon committed Nov 30, 2013
1 parent bbaa7af commit c15d3a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,12 @@
if ($('#md-menu').find ('li').length === 0) {
return;
}
var filename = $.md.mainHref;
var filename = window.location.hash;

if (filename.length === 0) {
filename = 'index.md';
filename = '#!index.md';
}
var selector = 'li:has(a[href$="' + filename + '"])';
var selector = 'li:has(a[href="' + filename + '"])';
$('#md-menu').find (selector).addClass ('active');
}

Expand Down

0 comments on commit c15d3a0

Please sign in to comment.