From 0a7bdfd63265de75e06808be33015209fbc94598 Mon Sep 17 00:00:00 2001 From: John Bender Date: Tue, 1 Feb 2011 21:58:37 -0800 Subject: [PATCH] whitespace in mobile core --- js/jquery.mobile.core.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index 2ae74555..01fee1b0 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -29,7 +29,7 @@ //automatically handle clicks and form submissions through Ajax, when same-domain ajaxEnabled: true, - + //automatically load and show pages based on location.hash hashListeningEnabled: true, @@ -57,7 +57,7 @@ gradeA: function(){ return $.support.mediaquery; }, - + //automatically initialize first pages or not. autoInitialize: true, @@ -144,16 +144,16 @@ } else { if( $.mobile.loadingMessage ){ var activeBtn =$( "." + $.mobile.activeBtnClass ).first(); - + $loader .appendTo( $.mobile.pageContainer ) //position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top .css( { - top: $.support.scrollTop && $(window).scrollTop() + $(window).height() / 2 || + top: $.support.scrollTop && $(window).scrollTop() + $(window).height() / 2 || activeBtn.length && activeBtn.offset().top || 100 } ); } - + $html.addClass( "ui-loading" ); } }, @@ -163,15 +163,17 @@ ypos = ypos || 0; // prevent scrollstart and scrollstop events $.event.special.scrollstart.enabled = false; + setTimeout(function() { window.scrollTo( 0, ypos ); $(document).trigger( "silentscroll", { x: 0, y: ypos }); },20); + setTimeout(function() { $.event.special.scrollstart.enabled = true; }, 150 ); }, - + // find and enhance the pages in the dom and transition to the first page. initializePage: function(){ //find present pages @@ -191,7 +193,7 @@ //cue page loading message $.mobile.pageLoading(); - // if hashchange listening is disabled or there's no hash deeplink, change to the first page in the DOM + // if hashchange listening is disabled or there's no hash deeplink, change to the first page in the DOM if( !$.mobile.hashListeningEnabled || !$.mobile.path.stripHash( location.hash ) ){ $.mobile.changePage( $.mobile.firstPage, false, true, false, true ); }