Skip to content

Commit

Permalink
Fix #36. The print-certificate style sheet was interfering with print…
Browse files Browse the repository at this point in the history
…ing the single-page view.
  • Loading branch information
michaelhagedon committed Nov 8, 2013
1 parent 3bf6040 commit adfb512
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
14 changes: 6 additions & 8 deletions app/View/Layouts/public.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@
<![endif]-->

<?php
if ($this->action != 'print_view') {
echo $this->Html->css('print_certificate', 'stylesheet',
array('media' => 'print', 'id' => 'print-certificate'));
echo "<!--[if IE 7]>";
echo $this->Html->css('print_certificate_ie', 'stylesheet',
array('media' => 'print', 'id' => 'print-certificate'));
echo "<![endif]-->";
}
echo $this->Html->css('print_certificate', 'stylesheet',
array('media' => 'print', 'id' => 'print-certificate'));
echo "<!--[if IE 7]>";
echo $this->Html->css('print_certificate_ie', 'stylesheet',
array('media' => 'print', 'id' => 'print-certificate'));
echo "<![endif]-->";
?>


Expand Down
16 changes: 8 additions & 8 deletions app/webroot/css/print_certificate.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@import url("email_print.css");

/* * is dangerous! */
* {
.print-certificate * {
display: none;
}

html, body, #email-print, #email-print h2, #email-print div, #email-print p {
.print-certificate body, #email-print, #email-print h2, #email-print div, #email-print p {
display: block !important;
}

Expand Down Expand Up @@ -41,7 +41,7 @@ html, body, #email-print, #email-print h2, #email-print div, #email-print p {
display: none !important;
}

.ui-widget {
.print-certificate .ui-widget {
background: none !important;
left: 0 !important;
top: 0 !important;
Expand All @@ -50,28 +50,28 @@ html, body, #email-print, #email-print h2, #email-print div, #email-print p {
font-family: inherit !important;
}

.ui-dialog {
.print-certificate .ui-dialog {
width: 90% !important;
height: auto !important;
}

.ui-dialog-buttonpane {
.print-certificate .ui-dialog-buttonpane {
display: none !important;
}

.ui-resizable-handle {
.print-certificate .ui-resizable-handle {
display: none !important;
}

.ui-dialog-titlebar {
.print-certificate .ui-dialog-titlebar {
display: none !important;
}

#email-print-wrapper {
height: 100% !important;
}

* { /* I can't find the element that's causing ticket #165, but this fixes it. */
.print-certificate * { /* I can't find the element that's causing ticket #165, but this fixes it. */
overflow: visible !important;
}

Expand Down
2 changes: 2 additions & 0 deletions app/webroot/js/tutorials/view_single_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ $(document).ready(function() {
this_element.dialog("close");
this_element.dialog("destroy");
this_element.remove();
$('body').removeClass('print-certificate');
}
},
width: 700,
Expand All @@ -73,6 +74,7 @@ $(document).ready(function() {
$('email-print').text();
}
});
$('body').addClass('print-certificate');
$('#email-print').dialog('open');
$('#email-print').closest('.ui-dialog').height('90%');
$('#email-print-wrapper').height($('#email-print').closest('.ui-dialog').height() - 200);
Expand Down
2 changes: 2 additions & 0 deletions app/webroot/js/tutorials/view_tutorial_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ $(document).ready(function() {
this_element.dialog("close");
this_element.dialog("destroy");
this_element.remove();
parent.$('body').removeClass('print-certificate');
}
},
width: 700,
Expand All @@ -91,6 +92,7 @@ $(document).ready(function() {
parent.$('email-print').text();
}
});
parent.$('body').addClass('print-certificate');
parent.$('#email-print').dialog('open');
parent.$('#email-print').closest('.ui-dialog').height('90%');
parent.$('#email-print-wrapper').height(parent.$('#email-print').closest('.ui-dialog').height() - 200);
Expand Down

0 comments on commit adfb512

Please sign in to comment.