Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Created October 22, 2014 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahemoff/8ff6d3782d2da6f9cbb3 to your computer and use it in GitHub Desktop.
Save mahemoff/8ff6d3782d2da6f9cbb3 to your computer and use it in GitHub Desktop.
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