From f779416c8d211e00eaf83fa4d89f2dbc2f12eb3b Mon Sep 17 00:00:00 2001 From: scottjehl Date: Mon, 26 Dec 2011 16:30:00 +0700 Subject: [PATCH] moved touchOverflowEnabled setting to global config, class is applied through page plugin. False by default. No longer dependent on fixed headers and footers. --- js/jquery.mobile.core.js | 3 +++ js/jquery.mobile.page.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index 790cda6c..eda5054c 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -37,6 +37,9 @@ // Minimum scroll distance that will be remembered when returning to a page minScrollBack: 250, + + // Enable touch-overflow scrolling for better transitions, in supporting browsers + touchOverflowEnabled: false, // Set default dialog transition - 'none' for no transitions defaultDialogTransition: "pop", diff --git a/js/jquery.mobile.page.js b/js/jquery.mobile.page.js index feaaa6fc..479efadf 100644 --- a/js/jquery.mobile.page.js +++ b/js/jquery.mobile.page.js @@ -18,6 +18,11 @@ $.widget( "mobile.page", $.mobile.widget, { this.element .attr( "tabindex", "0" ) .addClass( "ui-page ui-body-" + this.options.theme ); + + // if touchOverflow scrolling is enabled, add class + if( $.support.touchOverflow && $.mobile.touchOverflowEnabled ){ + this.element.addClass( "ui-mobile-touch-overflow" ); + } }, keepNativeSelector: function() {