| Issue 378: | How to tell if a modal is already open? | |
| 2 people starred this issue and may be notified of changes. | Back to list |
|
I am implementing bookmarking and back button functionality in an application that uses Nyromodal and need to know how to check if a modal is already open. I know you can call jQuery.nyroModalRemove(); to remove a modal, but I only want to do that if a modal is actually open. Thanks! |
||||||||
The best idea might be to add a global variable using one of the many callback. For instance, you can do: $.nyroModalSettings({ processHandler: function() { window.nyroModalHere = true; }, endRemove: function() { window.nyroModalHere = false; } }); As you guessed, you then only need to check against the var window.nyroModalHere.