-
Notifications
You must be signed in to change notification settings - Fork 124
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
Use event listener to restore header on expand window #1933
Use event listener to restore header on expand window #1933
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing to MarkBind @elroygohjy 👍
One suggestion, other than that it looks good.
packages/core-web/src/index.js
Outdated
window.addEventListener('resize', () => { | ||
if (window.innerWidth > 767 && headerSelector.hasClass('hide-header')) { | ||
headerSelector.removeClass('hide-header'); | ||
headerSelector.css('overflow', ''); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe can shift this out of the toggleHeaderOnScroll
method to line 110 so that this event listener is only added once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I refactored it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for fixing this @elroygohjy :)
LGTM 👍
@all-contributors please add @elroygohjy for code |
I've put up a pull request to add @elroygohjy! 🎉 |
What is the purpose of this pull request?
Overview of changes:
Fixes #1922
Anything you'd like to highlight / discuss:
I added event listener to listen resize event, as apparently window's innerwidth remains unchanged on clicking the expand window button.
Testing instructions:
Navbar reappears on expanding window/pressing expanding window button.
Proposed commit message: (wrap lines at 72 characters)
Fix navbar disappearing on expanding window