in pandora.js, load embed panel if needed

This commit is contained in:
rolux 2013-02-18 15:48:03 +05:30
parent 7d3c7dcfb3
commit aa76e1d4a2

View file

@ -42,18 +42,12 @@ appPanel
theme = legacyThemes[theme] || theme; theme = legacyThemes[theme] || theme;
if (isEmbed) { loadImages(function(images) {
loadScreen(images);
loadOxJS(function() { loadOxJS(function() {
loadOxUI(loadPandora); loadOxUI(loadPandora);
}); });
} else { });
loadImages(function(images) {
loadScreen(images);
loadOxJS(function() {
loadOxUI(loadPandora);
});
});
}
function loadImages(callback) { function loadImages(callback) {
// Opera doesn't fire onload for SVGs, // Opera doesn't fire onload for SVGs,
@ -171,7 +165,7 @@ appPanel
function loadOxUI(callback) { function loadOxUI(callback) {
Ox.load({ Ox.load({
UI: {theme: theme, showScreen: isEmbed, hideScreen: isEmbed}, UI: {theme: theme},
Geo: {} Geo: {}
}, callback); }, callback);
} }
@ -316,26 +310,29 @@ appPanel
} }
Ox.Theme(pandora.user.ui.theme); Ox.Theme(pandora.user.ui.theme);
pandora.$ui.appPanel = pandora.ui.appPanel().display(); if (isEmbed) {
Ox.Request.requests() && pandora.$ui.loadingIcon.start(); pandora.$ui.embedPanel = pandora.ui.embedPanel().display();
pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start); } else {
pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop); pandora.$ui.appPanel = pandora.ui.appPanel().display();
Ox.Request.bindEvent({ Ox.Request.requests() && pandora.$ui.loadingIcon.start();
error: pandora.ui.errorDialog, pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start);
request: function(data) { pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop);
pandora.$ui.loadingIcon.options({ Ox.Request.bindEvent({
tooltip: (data.requests || 'No') error: pandora.ui.errorDialog,
+ ' request' request: function(data) {
+ (data.requests == 1 ? '' : 's') 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) {}
} }
}); });