fix handling of ui.page on load (fixes #512)

This commit is contained in:
rolux 2012-02-18 06:35:38 +00:00
parent c64e16d724
commit b7d2d2302d
5 changed files with 11 additions and 12 deletions

View file

@ -130,12 +130,11 @@ appPanel
}
function loadOxJS(callback) {
var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement,
script = document.createElement('script');
var script = document.createElement('script');
script.onload = callback;
script.src = '/static/oxjs/dev/Ox.js';
script.type = 'text/javascript';
head.appendChild(script);
document.head.appendChild(script);
}
function loadOxUI(callback) {
@ -374,7 +373,7 @@ appPanel
.attr({
src: Ox.PATH + 'Ox.UI/png/browser' + browser.name.replace(' ', '') + '128.png'
})
.css({border: 0, width: '32px', height: '32px', margin: '4px'})
.css({width: '32px', height: '32px', margin: '4px'})
)
.appendTo($images);
});

View file

@ -79,7 +79,8 @@ pandora.URL = (function() {
var set = {
section: state.type == pandora.site.itemsSection ? 'items' : state.type,
item: state.item
item: state.item,
page: ''
};
if (state.view) {
@ -132,6 +133,7 @@ pandora.URL = (function() {
$(this).trigger('stop');
});
Ox.Log('URL', 'UI.set', set)
if (!pandora.$ui.appPanel && state.item && pandora.user.ui.find) {
// on page load, if item is set and there was a query,
// we have to check if the item actually matches the query,

View file

@ -37,11 +37,9 @@ pandora.ui.appPanel = function() {
});
function setPage(page) {
if (page === '') {
/*
if (pandora.$ui.home) {
pandora.$ui.home.fadeOutScreen();
} else
*/
['site', 'account', 'preferences', 'help'].forEach(function(dialog) {
pandora.$ui[dialog + 'Dialog'] && pandora.$ui[dialog + 'Dialog'].close();
});
if (pandora.$ui.tv) {
pandora.$ui.tv.fadeOutScreen();
}

View file

@ -137,7 +137,7 @@ pandora.ui.home = function() {
})
.bindEvent({
click: function() {
pandora.UI.set({page: ''});
pandora.UI.set({page: pandora.user.ui.page});
that.fadeOutScreen();
}
})

View file

@ -145,7 +145,7 @@ pandora.ui.home = function() {
})
.bindEvent({
click: function() {
pandora.UI.set({page: ''});
pandora.UI.set({page: pandora.user.ui.page});
that.fadeOutScreen();
}
})