This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 446
446
} ) ;
447
447
448
448
// Listen for resize changes
449
- var origOrientation = window . orientation ;
450
- window . addEventListener ( "orientationchange" , function ( ) {
451
- if ( window . orientation != origOrientation ) {
452
- $ ( "#sg-gen-container" ) . width ( $ ( window ) . width ( ) ) ;
453
- $ ( "#sg-viewport" ) . width ( $ ( window ) . width ( ) ) ;
454
- updateSizeReading ( $ ( window ) . width ( ) ) ;
455
- origOrientation = window . orientation ;
456
- }
457
- } , false ) ;
458
-
449
+ if ( window . orientation !== undefined ) {
450
+ var origOrientation = window . orientation ;
451
+ window . addEventListener ( "orientationchange" , function ( ) {
452
+ if ( window . orientation != origOrientation ) {
453
+ $ ( "#sg-gen-container" ) . width ( $ ( window ) . width ( ) ) ;
454
+ $ ( "#sg-viewport" ) . width ( $ ( window ) . width ( ) ) ;
455
+ updateSizeReading ( $ ( window ) . width ( ) ) ;
456
+ origOrientation = window . orientation ;
457
+ }
458
+ } , false ) ;
459
+
460
+ }
461
+
459
462
// watch the iframe source so that it can be sent back to everyone else.
460
463
// based on the great MDN docs at https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage
461
464
function receiveIframeMessage ( event ) {
You can’t perform that action at this time.
0 commit comments