-
Notifications
You must be signed in to change notification settings - Fork 86
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
Update pushbar.js #1
Conversation
Change some methods over to static methods (as they don't need this binding). Replace "current" property (pushbar ID) with "activeBar" to keep track of opened status & have active selector reference. A bit of refactoring
pushbar/pushbar.js
Outdated
const pushbar = Pushbar.findElementById(pushbarId); | ||
if (!pushbar) return; | ||
|
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.
Need to call the close method here , otherwise you can programmatically open multiple bars and will loose track of the active.
pushbar/pushbar.js
Outdated
const { activeBar } = this; | ||
if (!activeBar) return; | ||
|
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.
As it's a "closing" event I think it should emit right before the closing starts. So the dispatch close should be here.
Hey thanks for the changes, Really appreciate that, I've found 2 issues with the code, let me know what you think. |
Alright that should now be fixed |
Change some methods over to static methods (as they don't need this binding).
Replace "current" property (pushbar ID) with "activeBar" to keep track of opened status & have active selector reference.
A bit of refactoring