Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[secondary-sidebar] highlight active category #15

Open
pkra opened this issue Nov 22, 2015 · 3 comments
Open

[secondary-sidebar] highlight active category #15

pkra opened this issue Nov 22, 2015 · 3 comments

Comments

@pkra
Copy link
Member

pkra commented Nov 22, 2015

As per F2F

@pkra
Copy link
Member Author

pkra commented Nov 22, 2015

I'm tending towards client-side JS. From this SO answer a gloriously simple query.

document.querySelectorAll('a[href="'+document.URL.substring(27)+'"]')[0].className = "current";

However, for / the logo gets in the way.

var url = document.URL.substring(27);
if (url === '/'){
  document.querySelectorAll('a[href="'+url+'"]')[1].className = "current";
}
else {
  document.querySelectorAll('a[href="'+url+'"]')[0].className = "current";
}

Plus a style for .current. What do you think?

@pkra
Copy link
Member Author

pkra commented Dec 3, 2015

Gah! Running into specificity issues; need to learn CSS ;-)

@pkra
Copy link
Member Author

pkra commented Dec 3, 2015

Check out https://github.com/mathblogging/mathblogging.org/tree/issue15 for the horror.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant