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

Close on blur #152

Closed
wants to merge 5 commits into from
Closed

Close on blur #152

wants to merge 5 commits into from

Conversation

Wybrenb
Copy link
Contributor

@Wybrenb Wybrenb commented Jan 31, 2017

Scope

This pull request includes a

  • New feature

Changes

The following changes were made:

  • Add plugin option for closing a form when it is out of focus.

Information

This option give you the choice to open multiple forms, or to open one and only one, by closing another that is already open.
Also note the use of setTimeout, it's required because blur and focusout events are emitted when an element is about to lose focus, but haven't lost it yet. http://stackoverflow.com/questions/5049172/jquery-focus-blur-on-form-not-individual-inputs
The flag is added because a focusout event is fired, when submitting pressing enter, and it interferes with the animation. I couldn't differentiate between this unwanted event and wanted events. Also I couldn't prevent it.

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

Successfully merging this pull request may close these issues.

2 participants