Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. /** Print css **/
  2.  
  3. @media print {
  4. body.modalprinter * {
  5. visibility: hidden;
  6. }
  7.  
  8. body.modalprinter .modal-dialog.focused {
  9. position: absolute;
  10. padding: 0;
  11. margin: 0;
  12. left: 0;
  13. top: 0;
  14. }
  15.  
  16. body.modalprinter .modal-dialog.focused .modal-content {
  17. border-width: 0;
  18. }
  19.  
  20. body.modalprinter .modal-dialog.focused .modal-content .modal-header .modal-title,
  21. body.modalprinter .modal-dialog.focused .modal-content .modal-body,
  22. body.modalprinter .modal-dialog.focused .modal-content .modal-body * {
  23. visibility: visible;
  24. width: 100%;
  25. }
  26.  
  27. body.modalprinter .modal-dialog.focused .modal-content .modal-header,
  28. body.modalprinter .modal-dialog.focused .modal-content .modal-body {
  29. padding: 0;
  30. width: 100%;
  31. }
  32.  
  33. body.modalprinter .modal-dialog.focused .modal-content .modal-header .modal-title {
  34. margin-bottom: 20px;
  35. }
  36. }
  37.  
  38.  
  39. /* Script JS */
  40.  
  41. <script>
  42. $().ready(function () {
  43. $('.modal.printable').on('shown.bs.modal', function () {
  44. $('.modal-dialog', this).addClass('focused');
  45. $('body').addClass('modalprinter');
  46.  
  47. }).on('hidden.bs.modal', function () {
  48. $('.modal-dialog', this).removeClass('focused');
  49. $('body').removeClass('modalprinter');
  50. });
  51. });
  52. </script>
  53.  
  54.  
  55. / * Modal Bootsrap */
  56.  
  57. <div class="modal fade printable" id="doubtModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
  58. <div class="modal-dialog" role="document">
  59. <div class="modal-content">
  60. <div class="modal-header">
  61. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  62. <h4 class="modal-title" id="exampleModalLabel">Sobre o Sistema</h4>
  63. </div>
  64. <div class="modal-body">
  65.  
  66. <div class="well well-lg">
  67. <%= Doubt.first.body_html.html_safe %>
  68. </div>
  69.  
  70.  
  71. </div>
  72. <div class="modal-footer">
  73. <button type="button" class="btn btn-default" data-dismiss="modal"><%= t('buttons.close') %></button>
  74. <button type="button" class="btn btn-primary" onclick="window.print();">Imprimir</button>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement