fix a bug that would cause the home screen to flicker when loading /home directly

This commit is contained in:
rolux 2011-11-08 11:48:40 +00:00
parent 99b79000d2
commit 889e7f46a6
3 changed files with 9 additions and 4 deletions

View file

@ -67,8 +67,10 @@ pandora.URL = (function() {
} else if (state.page) { } else if (state.page) {
if (state.page == 'home') { if (state.page == 'home') {
//pandora.$ui.home = pandora.ui.home().showScreen(); // if we're on page load, show screen immediately
pandora.$ui.home = pandora.ui.home().fadeInScreen(); pandora.$ui.home = pandora.ui.home()[
!pandora.$ui.appPanel ? 'showScreen' : 'fadeInScreen'
]();
} else if ( } else if (
Ox.getPositionById(pandora.site.sitePages, state.page) > -1 Ox.getPositionById(pandora.site.sitePages, state.page) > -1
|| state.page == 'software' || state.page == 'software'

View file

@ -74,6 +74,11 @@ pandora.ui.accountDialogOptions = function(action, value) {
}).bindEvent('click', function() { }).bindEvent('click', function() {
pandora.$ui.accountDialog.options(pandora.ui.accountDialogOptions(type)); pandora.$ui.accountDialog.options(pandora.ui.accountDialogOptions(type));
pandora.$ui.accountForm.find('input')[0].focus(); 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);
}
}); });
} }
} }

View file

@ -240,7 +240,6 @@ pandora.ui.home = function() {
} }
that.fadeInScreen = function() { that.fadeInScreen = function() {
Ox.Log('', 'FADE IN SCREEN')
that.appendTo(Ox.UI.$body).animate({opacity: 1}, 500, function() { that.appendTo(Ox.UI.$body).animate({opacity: 1}, 500, function() {
that.find(':not(#logo)').animate({opacity: 1}, 250, function() { that.find(':not(#logo)').animate({opacity: 1}, 250, function() {
$findInput.focusInput(); $findInput.focusInput();
@ -267,7 +266,6 @@ pandora.ui.home = function() {
}; };
that.showScreen = function() { that.showScreen = function() {
Ox.Log('', 'SHOW SCREEN')
$logo.css({width: '320px'}); $logo.css({width: '320px'});
that.find(':not(#logo)').css({opacity: 1}); that.find(':not(#logo)').css({opacity: 1});
that.css({opacity: 1}).appendTo(Ox.UI.$body); that.css({opacity: 1}).appendTo(Ox.UI.$body);