You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was a partial attempt at this in #13 which I closed after suggesting a work around, but it would be nice to have the modals driven via declarative markup.
Use Cases
Display a modal that is a server rendered content fragment that an a.ajax click fetches
Close the modal on posting of a form rendered in the modal
Display secondary content in the modal after posting a form that was rendered initially in the modal.
Cases 1 and 2 are fairly easy to solve (at least I am pretty sure), the case in number 3 is a bit tricky as we want to avoid the modal closing and reopening and want the modal to just replace the insides instead of flashing about on the screen. One approach would be to have secondary fragments that were just replaced and not the entire div.modal but that could get out of hand in managing a ton of different templates.
Open to ideas/suggestions on this.
Currently, I think the best work around there is for this is to load the modal fragment as hidden and have the following script fragment to remove excess backgrounds and show the modal (this seems to work for me for most cases but would like to alleviate the need of evening having to do this):
There's also a case 1.5 : redisplay a form that came back from the server with errors.
At times it's also desirable to have client side javascript validation of the form inputs,
with the SUBMIT button disabled until the form validates (example: you must supply one of the following: email address or phone number).
There was a partial attempt at this in #13 which I closed after suggesting a work around, but it would be nice to have the modals driven via declarative markup.
Use Cases
a.ajax
click fetchesCases 1 and 2 are fairly easy to solve (at least I am pretty sure), the case in number 3 is a bit tricky as we want to avoid the modal closing and reopening and want the modal to just replace the insides instead of flashing about on the screen. One approach would be to have secondary fragments that were just replaced and not the entire
div.modal
but that could get out of hand in managing a ton of different templates.Open to ideas/suggestions on this.
Currently, I think the best work around there is for this is to load the modal fragment as hidden and have the following script fragment to remove excess backgrounds and show the modal (this seems to work for me for most cases but would like to alleviate the need of evening having to do this):
where
#my-modal
is referencing the id you place your modal div to make it unique.The text was updated successfully, but these errors were encountered: