diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index e8f2faca..5807dac0 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -53,6 +53,9 @@ pushStateEnabled: true, + // turn of binding to the native orientationchange due to android orientation behavior + orientationChangeEnabled: true, + // Support conditions that must be met in order to proceed // default enhanced qualifications are media query support OR IE 7+ gradeA: function(){ diff --git a/js/jquery.mobile.event.js b/js/jquery.mobile.event.js index d0e105f5..8d2d5247 100644 --- a/js/jquery.mobile.event.js +++ b/js/jquery.mobile.event.js @@ -190,7 +190,7 @@ $.event.special.swipe = { setup: function() { // If the event is supported natively, return false so that jQuery // will bind to the event using DOM methods. - if ( $.support.orientation ) { + if ( $.support.orientation && $.mobile.orientationChangeEnabled ) { return false; } @@ -204,7 +204,7 @@ $.event.special.swipe = { teardown: function(){ // If the event is not supported natively, return false so that // jQuery will unbind the event using DOM methods. - if ( $.support.orientation ) { + if ( $.support.orientation && $.mobile.orientationChangeEnabled ) { return false; } @@ -216,6 +216,7 @@ $.event.special.swipe = { // Save a reference to the bound event handler. var old_handler = handleObj.handler; + handleObj.handler = function( event ) { // Modify event object, adding the .orientation property. event.orientation = get_orientation();