Menu icon Foundation

My Posts

No Content

My Comments

David Reese commented on Harish Kumar's post about 4 years

In case anyone is trying to force the Foundation Reveal modal to stay open, programmatically, after it has already been open — for instance, you want to allow closing on background/escape, except when you're running an ajax request from the modal — you can set the options dynamically like this.

$('#modal').data('revealInit').close_on_background_click = false 
$('#modal').data('revealInit').close_on_esc = false 

And then set them to true when you're done. (Note that apparently the key "revealInit" could change, maybe something to do with namespaces? not sure when that happens.)

[edit]

Now that I say that, seems like this is the better solution:

 Foundation.libs.reveal.locked = true

Posts Followed


Following

    No Content

Followers

My Posts

No Content

My Comments

You commented on Harish Kumar's post about 4 years

In case anyone is trying to force the Foundation Reveal modal to stay open, programmatically, after it has already been open — for instance, you want to allow closing on background/escape, except when you're running an ajax request from the modal — you can set the options dynamically like this.

$('#modal').data('revealInit').close_on_background_click = false 
$('#modal').data('revealInit').close_on_esc = false 

And then set them to true when you're done. (Note that apparently the key "revealInit" could change, maybe something to do with namespaces? not sure when that happens.)

[edit]

Now that I say that, seems like this is the better solution:

 Foundation.libs.reveal.locked = true

Posts Followed

Following

  • No Content

Followers

  • No Content