Index: trunk/extensions/ProofreadPage/proofread.js |
— | — | @@ -580,20 +580,20 @@ |
581 | 581 | self.pr_horiz = horizontal_layout; |
582 | 582 | |
583 | 583 | //get the size of the window |
584 | | - var width, height; |
585 | | - if (parseInt(navigator.appVersion)>3) { |
586 | | - if (navigator.appName.indexOf("Microsoft")!=-1) { |
587 | | - height = document.body.clientHeight; |
588 | | - width = document.body.offsetWidth; |
589 | | - } |
590 | | - else{ |
591 | | - height = window.innerHeight; |
592 | | - width = window.innerWidth; |
593 | | - } |
| 584 | + var width = 0, height = 0; |
| 585 | + if( typeof( window.innerWidth ) == 'number' ) { |
| 586 | + //Non-IE |
| 587 | + width = window.innerWidth; |
| 588 | + height = window.innerHeight; |
| 589 | + } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { |
| 590 | + //IE 6+ in 'standards compliant mode' |
| 591 | + width = document.documentElement.clientWidth; |
| 592 | + height = document.documentElement.clientHeight; |
| 593 | + } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { |
| 594 | + //IE 4 compatible |
| 595 | + width = document.body.clientWidth; |
| 596 | + height = document.body.clientHeight; |
594 | 597 | } |
595 | | - else { |
596 | | - width = 800; height = 600; |
597 | | - } |
598 | 598 | |
599 | 599 | //fill the image container |
600 | 600 | if(!proofreadPageIsEdit) { |