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

Reuse sidebar on narrow screens script #222

Merged
merged 1 commit into from
Mar 8, 2020

Conversation

szpak
Copy link
Contributor

@szpak szpak commented Mar 6, 2020

It would be useful for #221, but anyway it's good to keep scrips in one place, if possible.

Btw, there were subtle differences between scripts. One version had:

if (document.getElementsByClassName('navbar__menu')[0]) {
    document.getElementsByClassName('navbar__menu')[0].classList.remove('is-active');
}
if (document.getElementsByClassName('mobile-search')[0]) {
    document.getElementsByClassName('mobile-search')[0].classList.add('hide');
}

while another just:

document.getElementsByClassName('navbar__menu')[0].classList.remove('is-active');
document.getElementsByClassName('mobile-search')[0].classList.add('hide');

I kept the first version as it seems to be safer and probably just hasn't been backported to other places.

@zzossig zzossig merged commit 14b1c7c into zzossig:master Mar 8, 2020
@zzossig
Copy link
Owner

zzossig commented Mar 8, 2020

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants