From 5725b4bac9f07e2cbd502ef6bc7c6213b076f315 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 24 Jan 2012 01:40:37 +0700 Subject: [PATCH] updated to bulletproof further --- js/jquery.mobile.zoom.iosorientationfix.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/jquery.mobile.zoom.iosorientationfix.js b/js/jquery.mobile.zoom.iosorientationfix.js index 847d22be..a361dc78 100644 --- a/js/jquery.mobile.zoom.iosorientationfix.js +++ b/js/jquery.mobile.zoom.iosorientationfix.js @@ -11,12 +11,13 @@ define( [ "jquery", "jquery.mobile.core", "jquery.mobile.zoom" ], function( $ ) function checkTilt( e ){ evt = e.originalEvent; aig = evt.accelerationIncludingGravity; - - x = Math.abs( aig.x ); + + x = Math.abs( aig.x ); y = Math.abs( aig.y ); z = Math.abs( aig.z ); - - if( !window.orientation && ( x > 8.1 || ( ( z > 6.5 || y > 6.5 ) && x > 5.5 ) ) ){ + + // If portrait orientation and in one of the danger zones + if( !w.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){ if( zoom.enabled ){ zoom.disable(); }