Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Dev - allow closeOnClick and closeOnEsc to be toggled after the overlay has been instantiated #1030

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

Open
wants to merge 6 commits into
base: dev
Choose a base branch
Loading
from

Conversation

smarden1
Copy link

There are a few different ideas conflating in this patch, but the general idea is to add some more programability to overlays. The following changes have been made...

  1. Exposed closeOnClick and closeOnEsc methods that allow you to change this option once an overlay is constructed. For example, you can now create an overlay that can be closed, and then if conditions change, you can disable that ability. This was previously very difficult to do. This also means that the eventhandler is added to all overlays and is toggled by the values of the closeOnClick and closeOnEsc variables.
  2. Since overlays are singletons, I've added the overlays function which will return all overlay that have been instantiated. I've also changed the uid function to use an incrementing counter instead of a random number.
  3. Added a simple function which will return a boolean indicating whether or not an element has an overlay attached to it. This is just a convenience method.

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.

1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.