Skip to content
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

Add first class support for bootstrap modals #37

Open
paltman opened this issue Apr 24, 2013 · 1 comment
Open

Add first class support for bootstrap modals #37

paltman opened this issue Apr 24, 2013 · 1 comment

Comments

@paltman
Copy link
Contributor

paltman commented Apr 24, 2013

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

  1. Display a modal that is a server rendered content fragment that an a.ajax click fetches
  2. Close the modal on posting of a form rendered in the modal
  3. 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):

<script>
    $(".modal-backdrop").remove();
    $("#my-modal").modal("show");
</script>

where #my-modal is referencing the id you place your modal div to make it unique.

@brycenesbitt
Copy link

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).

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

No branches or pull requests

2 participants