From 889e7f46a64cda6e32dc6c4df42af289215b5d0e Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 8 Nov 2011 11:48:40 +0000 Subject: [PATCH] fix a bug that would cause the home screen to flicker when loading /home directly --- static/js/pandora/URL.js | 6 ++++-- static/js/pandora/account.js | 5 +++++ static/js/pandora/home.js | 2 -- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 7d5c5a361..385f4828f 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -67,8 +67,10 @@ pandora.URL = (function() { } else if (state.page) { if (state.page == 'home') { - //pandora.$ui.home = pandora.ui.home().showScreen(); - pandora.$ui.home = pandora.ui.home().fadeInScreen(); + // if we're on page load, show screen immediately + pandora.$ui.home = pandora.ui.home()[ + !pandora.$ui.appPanel ? 'showScreen' : 'fadeInScreen' + ](); } else if ( Ox.getPositionById(pandora.site.sitePages, state.page) > -1 || state.page == 'software' diff --git a/static/js/pandora/account.js b/static/js/pandora/account.js index 8c141f064..cb7071237 100644 --- a/static/js/pandora/account.js +++ b/static/js/pandora/account.js @@ -74,6 +74,11 @@ pandora.ui.accountDialogOptions = function(action, value) { }).bindEvent('click', function() { pandora.$ui.accountDialog.options(pandora.ui.accountDialogOptions(type)); pandora.$ui.accountForm.find('input')[0].focus(); + if (['signin', 'signup'].indexOf(type) > -1) { + // fixme: similar problem as in siteDialog, + // the URL controller should handle this + history.replaceState({}, '', '/' + type); + } }); } } diff --git a/static/js/pandora/home.js b/static/js/pandora/home.js index b8285aa16..7583a5b74 100644 --- a/static/js/pandora/home.js +++ b/static/js/pandora/home.js @@ -240,7 +240,6 @@ pandora.ui.home = function() { } that.fadeInScreen = function() { - Ox.Log('', 'FADE IN SCREEN') that.appendTo(Ox.UI.$body).animate({opacity: 1}, 500, function() { that.find(':not(#logo)').animate({opacity: 1}, 250, function() { $findInput.focusInput(); @@ -267,7 +266,6 @@ pandora.ui.home = function() { }; that.showScreen = function() { - Ox.Log('', 'SHOW SCREEN') $logo.css({width: '320px'}); that.find(':not(#logo)').css({opacity: 1}); that.css({opacity: 1}).appendTo(Ox.UI.$body);