Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Vertically center BootstrapDialog. Put this code in your own application and ensure Bootstrap and BootstrapDialog were already sourced. Credit: http://stackoverflow.com/a/20486657/18706
.centerModal .modal-header{
text-align:left;
}
.centerModal .modal-body{
text-align:left;
}
BootstrapDialog.prototype.open = ->
@realize() unless @isRealized()
@updateClosable()
$mymodal = @getModal()
$mymodal = $mymodal.append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\"><tr><td align=\"center\" valign=\"middle\" class=\"cen
terModal\"></td></tr></table>")
$mymodal = $mymodal.find(".modal-dialog").appendTo($mymodal.find(".centerModal"))
@getModal().modal "show"
this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.