forked from 0x2620/pandora
use ui.help (still not correct)
This commit is contained in:
parent
9c54344918
commit
adbc8666c0
3 changed files with 16 additions and 13 deletions
|
@ -18,7 +18,8 @@ pandora.URL = (function() {
|
|||
|
||||
} 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)];
|
||||
|
||||
if (pandora.user.ui.section == 'items') {
|
||||
|
@ -119,6 +120,9 @@ pandora.URL = (function() {
|
|||
if (state.page) {
|
||||
|
||||
set.page = state.page;
|
||||
if (state.page == 'help') {
|
||||
set.help = state.hash ? state.hash.anchor : '';
|
||||
}
|
||||
pandora.UI.set(set);
|
||||
callback && callback();
|
||||
|
||||
|
|
|
@ -3,10 +3,7 @@
|
|||
|
||||
pandora.ui.helpDialog = function() {
|
||||
|
||||
var selected = pandora.user.ui.hash && pandora.user.ui.hash.anchor
|
||||
? pandora.user.ui.hash.anchor : 'help',
|
||||
|
||||
text = {},
|
||||
var text = {},
|
||||
|
||||
$loading = Ox.Element()
|
||||
.append(
|
||||
|
@ -64,7 +61,7 @@ pandora.ui.helpDialog = function() {
|
|||
resize: function() {
|
||||
$list.size();
|
||||
},
|
||||
'pandora_hash.anchor': function(data) {
|
||||
'pandora_help': function(data) {
|
||||
pandora.user.ui.page == 'help' &&
|
||||
that.select(data.value == '' ? 'help' : data.value);
|
||||
}
|
||||
|
@ -105,14 +102,14 @@ pandora.ui.helpDialog = function() {
|
|||
max: 1,
|
||||
min: 1,
|
||||
scrollbarVisible: true,
|
||||
selected: [selected],
|
||||
selected: [pandora.user.ui.help || 'help'],
|
||||
sort: [{key: 'index', operator: '+'}],
|
||||
unique: 'id'
|
||||
})
|
||||
.bindEvent({
|
||||
select: function(data) {
|
||||
var id = data.ids[0];
|
||||
pandora.UI.set({'hash.anchor': id == 'help' ? '' : id});
|
||||
var id = data.ids[0] == 'help' ? '' : data.ids[0];
|
||||
pandora.UI.set({help: id, 'hash.anchor': id});
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -134,13 +131,13 @@ pandora.ui.helpDialog = function() {
|
|||
orientation: 'horizontal'
|
||||
});
|
||||
|
||||
that.select(selected).options({content: $panel});
|
||||
that.select(pandora.user.ui.help).options({content: $panel});
|
||||
$list.gainFocus();
|
||||
|
||||
});
|
||||
|
||||
that.select = function(id) {
|
||||
$text.html(text[id]).scrollTop(0);
|
||||
$text.html(text[id || 'help']).scrollTop(0);
|
||||
$text.find('img')
|
||||
.css({
|
||||
width: '100%',
|
||||
|
|
|
@ -286,7 +286,7 @@ pandora.ui.mainMenu = function() {
|
|||
click: function(data) {
|
||||
if ([
|
||||
'home', 'software', 'signup', 'signin', 'signout',
|
||||
'preferences', 'tv', 'help', 'api'
|
||||
'preferences', 'tv', 'api'
|
||||
].concat(
|
||||
pandora.site.sitePages.map(function(page) {
|
||||
return page.id;
|
||||
|
@ -352,6 +352,8 @@ pandora.ui.mainMenu = function() {
|
|||
filters: pandora.site.user.ui.filters
|
||||
});
|
||||
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') {
|
||||
Ox.Request.clearCache();
|
||||
} else if (data.id == 'reloadapplication') {
|
||||
|
@ -420,7 +422,7 @@ pandora.ui.mainMenu = function() {
|
|||
},
|
||||
key_control_slash: function() {
|
||||
if (!pandora.hasDialogOrScreen()) {
|
||||
pandora.UI.set({page: 'help'});
|
||||
pandora.UI.set({page: 'help', 'hash.anchor': ui.help});
|
||||
}
|
||||
},
|
||||
key_control_space: function() {
|
||||
|
|
Loading…
Reference in a new issue