Skip to content

Commit

Permalink
Added workaround for nav-current matching in IE7 to deal with href ab…
Browse files Browse the repository at this point in the history
…solute bug.
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Sep 20, 2012
1 parent c075c62 commit b157a8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/js/pe-ap-min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/js/pe-ap.js
Expand Up @@ -726,7 +726,8 @@
bcindex,
h1text = pe.main.find('h1').text(),
addslash = true,
match = false;
match = false,
hrefBug = pe.ie !== 0 && pe.ie < 8; // IE7 and below have an href bug so need a workaround
menusrc = typeof menusrc.jquery !== 'undefined' ? menusrc : $(menusrc);
menulinks = menusrc.find('a').get();
menulinkslen = menulinks.length;
Expand All @@ -737,7 +738,7 @@

while (menulinkslen--) {
menulink = menulinks[menulinkslen];
if (menulink.getAttribute('href').slice(0, 1) !== '#') {
if ((!hrefBug && menulink.getAttribute('href').slice(0, 1) !== '#') || (hrefBug && (menulink.href.indexOf('#') === -1 || pageurl !== menulink.hostname + menulink.pathname.replace(/^([^\/])/, '/$1')))) {
menulinkurl = menulink.hostname + menulink.pathname.replace(/^([^\/])/, '/$1');
menulinkurllen = menulinkurl.length;
menulinkquery = menulink.search;
Expand Down

0 comments on commit b157a8d

Please sign in to comment.