From c484629e840f98a048c523f8fbf05d9cab14b891 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Sun, 3 Oct 2010 16:43:50 -0400 Subject: [PATCH] reworked the timing and styles for the pageLoading sequences in attempt to reduce blinky behavior. Small improvements... --- css/jQuery.mobile.core.css | 7 +++---- js/jQuery.mobile.js | 19 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/css/jQuery.mobile.core.css b/css/jQuery.mobile.core.css index a4e5967f..d459ea3a 100644 --- a/css/jQuery.mobile.core.css +++ b/css/jQuery.mobile.core.css @@ -33,11 +33,10 @@ /* loading screen */ .ui-loading, .ui-loading body { overflow: hidden !important; } -.ui-loading .ui-content { visibility: hidden; } .ui-loading .ui-loader { display: block; } -.ui-loader { display: none; position: absolute; z-index: 0; top: 100px; left: 50%; width: 100px; margin-left: -80px; padding: 20px 30px; border: 0; } -.ui-loader h1 { font-size: 15px; text-align: center; opacity: .8; } -.ui-loader .ui-icon { position: static; display: block; opacity: .7; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; } +.ui-loader { display: none; position: absolute; opacity: .7; z-index: 10; top: 75px; left: 50%; width: 200px; margin-left: -130px; padding: 20px 30px; } +.ui-loader h1 { font-size: 15px; text-align: center; } +.ui-loader .ui-icon { position: static; display: block; opacity: .9; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; } /*headers, content panels*/ .ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; } diff --git a/js/jQuery.mobile.js b/js/jQuery.mobile.js index 5dd7906b..6cd7a60e 100644 --- a/js/jQuery.mobile.js +++ b/js/jQuery.mobile.js @@ -23,7 +23,7 @@ $html = jQuery('html'), $head = jQuery('head'), $body, - $loader = jQuery('

loading.

'), + $loader = jQuery('

loading.

'), startPage, startPageId = 'ui-page-start', activePageClass = 'ui-page-active', @@ -42,7 +42,9 @@ function hideBrowserChrome() { // prevent scrollstart and scrollstop events jQuery.event.special.scrollstart.enabled = false; - window.scrollTo( 0, 0 ); + setTimeout(function() { + window.scrollTo( 0, 0 ); + },0); setTimeout(function() { jQuery.event.special.scrollstart.enabled = true; }, 150 ); @@ -104,22 +106,18 @@ return false; }); - // turn on/off page loading message.. also hides the ui-content div + // turn on/off page loading message. function pageLoading( done ) { if ( done ) { $html.removeClass( "ui-loading" ); - //fade in page content, remove loading msg - jQuery('.ui-page-active .ui-content').addClass('dissolve in'); } else { + $loader.appendTo('body'); $html.addClass( "ui-loading" ); - $loader.appendTo( $body ).addClass( "dissolve in" ); } }; // transition between pages - based on transitions from jQtouch function changePage( from, to, transition, back ) { - hideBrowserChrome(); - // kill keyboard (thx jQtouch :) ) jQuery( document.activeElement ).blur(); @@ -223,8 +221,6 @@ } } }); - - hideBrowserChrome(); }); //add orientation class on flip/resize. @@ -374,4 +370,7 @@ jQuery('#eventlogger').prepend('
Event fired: '+ e.type +'
'); }); }); + + $window.load(hideBrowserChrome); + })( jQuery, this );