1 (function( $, window ) {
3 // This fix addresses an iOS bug, so return early if the UA claims it's something else.
4 if ( !(/iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1 ) ) {
8 var zoom = $.mobile.zoom,
11 function checkTilt( e ) {
12 evt = e.originalEvent;
13 aig = evt.accelerationIncludingGravity;
15 x = Math.abs( aig.x );
16 y = Math.abs( aig.y );
17 z = Math.abs( aig.z );
19 // If portrait orientation and in one of the danger zones
20 if ( !window.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ) {
24 } else if ( !zoom.enabled ) {
30 .bind( "orientationchange.iosorientationfix", zoom.enable )
31 .bind( "devicemotion.iosorientationfix", checkTilt );