From aa76e1d4a2db0c82a118f99a84a73739734e58ff Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 18 Feb 2013 15:48:03 +0530 Subject: [PATCH] in pandora.js, load embed panel if needed --- static/js/pandora.js | 55 +++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/static/js/pandora.js b/static/js/pandora.js index 372db2a85..5210c90bd 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -42,18 +42,12 @@ appPanel theme = legacyThemes[theme] || theme; - if (isEmbed) { + loadImages(function(images) { + loadScreen(images); loadOxJS(function() { loadOxUI(loadPandora); }); - } else { - loadImages(function(images) { - loadScreen(images); - loadOxJS(function() { - loadOxUI(loadPandora); - }); - }); - } + }); function loadImages(callback) { // Opera doesn't fire onload for SVGs, @@ -171,7 +165,7 @@ appPanel function loadOxUI(callback) { Ox.load({ - UI: {theme: theme, showScreen: isEmbed, hideScreen: isEmbed}, + UI: {theme: theme}, Geo: {} }, callback); } @@ -316,26 +310,29 @@ appPanel } Ox.Theme(pandora.user.ui.theme); - 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') - }); + if (isEmbed) { + pandora.$ui.embedPanel = pandora.ui.embedPanel().display(); + } else { + 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 (localStorage && localStorage['pandora.onload']) { + try { + eval(localStorage['pandora.onload']) + } catch(e) {} } - }); - pandora.site.sectionButtonsWidth = pandora.$ui.sectionButtons.width() + 8; - - if (localStorage && localStorage['pandora.onload']) { - try { - eval(localStorage['pandora.onload']) - } catch(e) {} } });