diff --git a/static/js/pandora/apiDialog.js b/static/js/pandora/apiDialog.js index 5dd1411c4..628581249 100644 --- a/static/js/pandora/apiDialog.js +++ b/static/js/pandora/apiDialog.js @@ -31,10 +31,10 @@ pandora.ui.apiDialog = function() { title: 'Help...' }).bindEvent({ click: function() { - pandora.UI.set({page: 'help', 'hash.anchor': ''}) + pandora.UI.set({page: 'help', 'hash.anchor': ''}); } }), - {}, + {}, Ox.Button({ id: 'close', title: 'Close' @@ -66,7 +66,7 @@ pandora.ui.apiDialog = function() { pandora.user.ui.page == 'api' && that.select(data.value); } }), - overview = '

API Documentation

use this api in the browser with Ox.app or use pandora_client it in python. Further description of the api can be found on the wiki
'; + overview = '

API Documentation


use this api in the browser with Ox.app or use pandora_client it in python. Further description of the api can be found on the wiki'; pandora.api.api({docs: true, code: true}, function(results) { var items = [{ @@ -96,7 +96,7 @@ pandora.ui.apiDialog = function() { max: 1, min: 1, scrollbarVisible: true, - selected: [], + selected: [selected], sort: [{key: 'sort', operator: '+'}], unique: 'id' }) @@ -122,20 +122,14 @@ pandora.ui.apiDialog = function() { orientation: 'horizontal' }); - that.options({content: $panel}); + that.select(selected).options({content: $panel}); + $list.gainFocus(); }); that.select = function(id) { - if (id) { - $text.html(''); - $text.append( - $('

') - .html(id) - .css({ - marginBottom: '8px' - }) - ); + if (id && actions[id]) { + $text.html('

' + id + '


'); var code = actions[id].code[1], f = actions[id].code[0], line = Math.round(Ox.last(f.split(':')) || 0), diff --git a/static/js/pandora/helpDialog.js b/static/js/pandora/helpDialog.js index 15a6bbc5a..61f95f4d5 100644 --- a/static/js/pandora/helpDialog.js +++ b/static/js/pandora/helpDialog.js @@ -33,7 +33,7 @@ pandora.ui.helpDialog = function() { title: 'API Documentation...' }).bindEvent({ click: function() { - pandora.UI.set({page: 'api', 'hash.anchor': ''}) + pandora.UI.set({page: 'api', 'hash.anchor': ''}); } }), {},