forked from kylefox/jquery-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show/hide modals when navigating with back/forward buttons
Using pushState and popState event handlers, we can understand when the modal needs to be closed (and prevents the browser from navigating away), and when the modal needs to be reopened (using the new modal:reopen event). By default this is turned off, but can be enabled in the modal options with `updateHistory: true`. Note that as this stands, this doesn't work very well with Turbolinks: I'm not sure yet if this is a bug on the Turbolinks side or not, but in the meantime, this behaviour works for non-Turbolinks sites.
- Loading branch information
1 parent
a229f49
commit 00cfc77
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters