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

Update pushbar.js #1

Merged
merged 4 commits into from
Jul 18, 2018
Merged

Update pushbar.js #1

merged 4 commits into from
Jul 18, 2018

Conversation

jamsch
Copy link
Contributor

@jamsch jamsch commented Jul 17, 2018

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

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
const pushbar = Pushbar.findElementById(pushbarId);
if (!pushbar) return;

Copy link
Owner

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.

const { activeBar } = this;
if (!activeBar) return;

Copy link
Owner

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.

@oncebot
Copy link
Owner

oncebot commented Jul 17, 2018

Hey thanks for the changes, Really appreciate that, I've found 2 issues with the code, let me know what you think.

@jamsch
Copy link
Contributor Author

jamsch commented Jul 18, 2018

Alright that should now be fixed

@oncebot oncebot merged commit e15a711 into oncebot:master Jul 18, 2018
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