update help and api dialogs (new urls: slash, not hash)

This commit is contained in:
rolux 2013-07-11 18:18:19 +00:00
parent f7775c56a1
commit 43ee3531bf
2 changed files with 12 additions and 13 deletions

View file

@ -3,8 +3,8 @@
pandora.ui.apiDialog = function() { pandora.ui.apiDialog = function() {
var selected = pandora.user.ui.hash && pandora.user.ui.hash.anchor var selected = pandora.user.ui.part.api,
? pandora.user.ui.hash.anchor : '',
actions, actions,
$panel, $list, $text, $panel, $list, $text,
@ -16,7 +16,7 @@ pandora.ui.apiDialog = function() {
title: Ox._('Help...') title: Ox._('Help...')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
pandora.UI.set({page: 'help', 'hash.anchor': ''}); pandora.UI.set({page: 'help'});
} }
}), }),
{}, {},
@ -42,12 +42,12 @@ pandora.ui.apiDialog = function() {
}) })
.bindEvent({ .bindEvent({
close: function() { close: function() {
pandora.user.ui.page == 'api' && pandora.UI.set({page: '', 'hash.anchor': ''}); pandora.user.ui.page == 'api' && pandora.UI.set({page: ''});
}, },
resize: function() { resize: function() {
$list.size(); $list.size();
}, },
'pandora_hash.anchor': function(data) { 'pandora_part.api': function(data) {
pandora.user.ui.page == 'api' && that.select(data.value); pandora.user.ui.page == 'api' && that.select(data.value);
} }
}); });
@ -56,7 +56,7 @@ pandora.ui.apiDialog = function() {
var items = [{ var items = [{
id: '', id: '',
title: Ox._('API Documentation'), title: Ox._('API Documentation'),
sort: 'aaa' sort: 'aaa' // FIXME: what's this?
}]; }];
actions = results.data.actions; actions = results.data.actions;
Ox.forEach(results.data.actions, function(v, k) { Ox.forEach(results.data.actions, function(v, k) {
@ -87,7 +87,7 @@ pandora.ui.apiDialog = function() {
.bindEvent({ .bindEvent({
select: function(data) { select: function(data) {
var id = data.ids[0]; var id = data.ids[0];
pandora.UI.set({'hash.anchor': id}); pandora.UI.set({'part.api': id});
} }
}); });
@ -199,7 +199,6 @@ pandora.ui.apiDialog = function() {
borderWidth: '1px', borderWidth: '1px',
}).appendTo($text); }).appendTo($text);
} else { } else {
Ox.print('ELSE')
$text.empty().append(getIndex()); $text.empty().append(getIndex());
} }
$text.scrollTop(0); $text.scrollTop(0);

View file

@ -14,7 +14,7 @@ pandora.ui.helpDialog = function() {
title: Ox._('API Documentation...') title: Ox._('API Documentation...')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
pandora.UI.set({page: 'api', 'hash.anchor': ''}); pandora.UI.set({page: 'api'});
} }
}), }),
{}, {},
@ -40,10 +40,10 @@ pandora.ui.helpDialog = function() {
}) })
.bindEvent({ .bindEvent({
close: function() { close: function() {
pandora.user.ui.page == 'help' && pandora.UI.set({page: '', 'hash.anchor': ''}); pandora.user.ui.page == 'help' && pandora.UI.set({page: ''});
}, },
resize: resize, resize: resize,
'pandora_help': function(data) { 'pandora_part.help': function(data) {
if (pandora.user.ui.page == 'help') { if (pandora.user.ui.page == 'help') {
that.select(data.value == '' ? 'help' : data.value); that.select(data.value == '' ? 'help' : data.value);
} }
@ -87,14 +87,14 @@ pandora.ui.helpDialog = function() {
max: 1, max: 1,
min: 1, min: 1,
scrollbarVisible: true, scrollbarVisible: true,
selected: [pandora.user.ui.help || 'help'], selected: [pandora.user.ui.part.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] == 'help' ? '' : data.ids[0]; var id = data.ids[0] == 'help' ? '' : data.ids[0];
pandora.UI.set({help: id, 'hash.anchor': id}); pandora.UI.set({'part.help': id});
} }
}); });