Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix printing error in IE9 by putting the print media check before att…

…empting to access window.PIE
  • Loading branch information...
commit c080e1b830741432ae397f6098470b132a76a6af 1 parent 0c0087f
Jason Johnston authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 sources/htc_script.js
16 sources/htc_script.js
View
@@ -72,16 +72,20 @@ if ( !window[ 'PIE' ] && docMode < 10 ) {
}
function init() {
- var PIE = window[ 'PIE' ];
- if( PIE && doc.media !== 'print' ) { // IE strangely attaches a second copy of the behavior to elements when printing
- PIE[ 'attach' ]( el );
+ if ( doc.media !== 'print' ) { // IE strangely attaches a second copy of the behavior to elements when printing
+ var PIE = window[ 'PIE' ];
+ if( PIE ) {
+ PIE[ 'attach' ]( el );
+ }
}
}
function cleanup() {
- var PIE = window[ 'PIE' ];
- if ( PIE && doc.media !== 'print' ) {
- PIE[ 'detach' ]( el );
+ if ( doc.media !== 'print' ) {
+ var PIE = window[ 'PIE' ];
+ if ( PIE ) {
+ PIE[ 'detach' ]( el );
+ }
}
el = 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.