load home screen first, and app panel upon home screen callback (allowing for animation without the app panel blocking rendering)

This commit is contained in:
rolux 2013-07-09 09:04:35 +00:00
parent dde8e55507
commit 208a38c419

View file

@ -318,16 +318,16 @@ appPanel
videoFormat: Ox.UI.getVideoFormat(pandora.site.video.formats) videoFormat: Ox.UI.getVideoFormat(pandora.site.video.formats)
}); });
// set up url controller // set locale and initialize url controller
pandora.setLocale(pandora.user.ui.locale, function() { pandora.setLocale(pandora.user.ui.locale, function() {
pandora.URL.init().parse(function() { pandora.URL.init().parse(function() {
var isHome = Ox.contains(['/', '/home'], document.location.pathname);
if (data.browserSupported) { if (data.browserSupported) {
stopAnimation(); stopAnimation();
$('#loadingScreen').remove(); $('#loadingScreen').remove();
} else { } else {
loadBrowserMessage(); loadBrowserMessage();
} }
Ox.Theme(pandora.user.ui.theme); Ox.Theme(pandora.user.ui.theme);
if (isEmbed) { if (isEmbed) {
pandora.$ui.embedPanel = pandora.ui.embedPanel().display(); pandora.$ui.embedPanel = pandora.ui.embedPanel().display();
@ -345,33 +345,39 @@ appPanel
}); });
} else if (isPrint) { } else if (isPrint) {
pandora.$ui.printView = pandora.ui.printView().display(); pandora.$ui.printView = pandora.ui.printView().display();
} else if (isHome) {
pandora.$ui.home = pandora.ui.home().showScreen(initPandoraApp);
} else { } else {
pandora.$ui.appPanel = pandora.ui.appPanel().display(); initPandoraApp();
Ox.Request.requests() && pandora.$ui.loadingIcon.start();
pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start);
pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop);
Ox.Request.bindEvent({
error: pandora.ui.errorDialog,
request: function(data) {
pandora.$ui.loadingIcon.options({
tooltip: (data.requests || 'No')
+ ' request'
+ (data.requests == 1 ? '' : 's')
});
}
});
pandora.site.sectionButtonsWidth = pandora.$ui.sectionButtons.width() + 8;
if (getLocalStorage('pandora.onload')) {
try {
eval(localStorage['pandora.onload'])
} catch(e) {}
}
} }
}); });
}); });
} }
function initPandoraApp() {
pandora.$ui.appPanel = pandora.ui.appPanel().display();
Ox.Request.requests() && pandora.$ui.loadingIcon.start();
pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start);
pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop);
Ox.Request.bindEvent({
error: pandora.ui.errorDialog,
request: function(data) {
pandora.$ui.loadingIcon.options({
tooltip: (data.requests || 'No')
+ ' request'
+ (data.requests == 1 ? '' : 's')
});
}
});
pandora.site.sectionButtonsWidth = pandora.$ui.sectionButtons.width() + 8;
if (getLocalStorage('pandora.onload')) {
try {
eval(localStorage['pandora.onload'])
} catch(e) {}
}
}
function loadBrowserMessage() { function loadBrowserMessage() {
var browsers = [].concat( var browsers = [].concat(
isMSIE ? [{name: 'Chrome Frame', url: 'http://google.com/chromeframe/'}] : [], isMSIE ? [{name: 'Chrome Frame', url: 'http://google.com/chromeframe/'}] : [],