use ui.help (still not correct)

This commit is contained in:
rolux 2013-03-06 13:28:44 +00:00
parent 9c54344918
commit adbc8666c0
3 changed files with 16 additions and 13 deletions

View file

@ -18,7 +18,8 @@ pandora.URL = (function() {
} else { } else {
state.type = pandora.user.ui.section == 'items' ? pandora.site.itemsSection : pandora.user.ui.section; state.type = pandora.user.ui.section == 'items'
? pandora.site.itemsSection : pandora.user.ui.section;
state.item = pandora.user.ui[pandora.user.ui.section.slice(0, -1)]; state.item = pandora.user.ui[pandora.user.ui.section.slice(0, -1)];
if (pandora.user.ui.section == 'items') { if (pandora.user.ui.section == 'items') {
@ -119,6 +120,9 @@ pandora.URL = (function() {
if (state.page) { if (state.page) {
set.page = state.page; set.page = state.page;
if (state.page == 'help') {
set.help = state.hash ? state.hash.anchor : '';
}
pandora.UI.set(set); pandora.UI.set(set);
callback && callback(); callback && callback();

View file

@ -3,10 +3,7 @@
pandora.ui.helpDialog = function() { pandora.ui.helpDialog = function() {
var selected = pandora.user.ui.hash && pandora.user.ui.hash.anchor var text = {},
? pandora.user.ui.hash.anchor : 'help',
text = {},
$loading = Ox.Element() $loading = Ox.Element()
.append( .append(
@ -64,7 +61,7 @@ pandora.ui.helpDialog = function() {
resize: function() { resize: function() {
$list.size(); $list.size();
}, },
'pandora_hash.anchor': function(data) { 'pandora_help': function(data) {
pandora.user.ui.page == 'help' && pandora.user.ui.page == 'help' &&
that.select(data.value == '' ? 'help' : data.value); that.select(data.value == '' ? 'help' : data.value);
} }
@ -105,14 +102,14 @@ pandora.ui.helpDialog = function() {
max: 1, max: 1,
min: 1, min: 1,
scrollbarVisible: true, scrollbarVisible: true,
selected: [selected], selected: [pandora.user.ui.help || 'help'],
sort: [{key: 'index', operator: '+'}], sort: [{key: 'index', operator: '+'}],
unique: 'id' unique: 'id'
}) })
.bindEvent({ .bindEvent({
select: function(data) { select: function(data) {
var id = data.ids[0]; var id = data.ids[0] == 'help' ? '' : data.ids[0];
pandora.UI.set({'hash.anchor': id == 'help' ? '' : id}); pandora.UI.set({help: id, 'hash.anchor': id});
} }
}); });
@ -134,13 +131,13 @@ pandora.ui.helpDialog = function() {
orientation: 'horizontal' orientation: 'horizontal'
}); });
that.select(selected).options({content: $panel}); that.select(pandora.user.ui.help).options({content: $panel});
$list.gainFocus(); $list.gainFocus();
}); });
that.select = function(id) { that.select = function(id) {
$text.html(text[id]).scrollTop(0); $text.html(text[id || 'help']).scrollTop(0);
$text.find('img') $text.find('img')
.css({ .css({
width: '100%', width: '100%',

View file

@ -286,7 +286,7 @@ pandora.ui.mainMenu = function() {
click: function(data) { click: function(data) {
if ([ if ([
'home', 'software', 'signup', 'signin', 'signout', 'home', 'software', 'signup', 'signin', 'signout',
'preferences', 'tv', 'help', 'api' 'preferences', 'tv', 'api'
].concat( ].concat(
pandora.site.sitePages.map(function(page) { pandora.site.sitePages.map(function(page) {
return page.id; return page.id;
@ -352,6 +352,8 @@ pandora.ui.mainMenu = function() {
filters: pandora.site.user.ui.filters filters: pandora.site.user.ui.filters
}); });
pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser()); pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser());
} else if (data.id == 'help') {
pandora.UI.set({page: 'help', 'hash.anchor': ui.help});
} else if (data.id == 'clearcache') { } else if (data.id == 'clearcache') {
Ox.Request.clearCache(); Ox.Request.clearCache();
} else if (data.id == 'reloadapplication') { } else if (data.id == 'reloadapplication') {
@ -420,7 +422,7 @@ pandora.ui.mainMenu = function() {
}, },
key_control_slash: function() { key_control_slash: function() {
if (!pandora.hasDialogOrScreen()) { if (!pandora.hasDialogOrScreen()) {
pandora.UI.set({page: 'help'}); pandora.UI.set({page: 'help', 'hash.anchor': ui.help});
} }
}, },
key_control_space: function() { key_control_space: function() {