From d2c760a9a663b4d0b756b9e9dd84337feac20c59 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 24 Dec 2010 18:37:52 +0530 Subject: [PATCH] load functions from hashurl --- static/js/pandora.api.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/static/js/pandora.api.js b/static/js/pandora.api.js index ed1b687..6263225 100755 --- a/static/js/pandora.api.js +++ b/static/js/pandora.api.js @@ -24,7 +24,13 @@ var app = new Ox.App({ app.$ui.actionList = constructList(); app.$ui.actionInfo = Ox.Container().css({padding: '8px'}); - app.api.apidoc(function(results) { app.docs = results.data.actions; }); + app.api.apidoc(function(results) { + app.docs = results.data.actions; + + if(document.location.hash) { + app.$ui.actionList.triggerEvent('select', {ids: document.location.hash.substring(1).split(',')}); + } + }); var $main = new Ox.SplitPanel({ elements: [ @@ -40,11 +46,6 @@ var app = new Ox.App({ }); $main.appendTo(app.$body); - if(document.location.hash) { - var action = document.location.hash.substring(1); - //FIXME: how to select item in Ox.TextList? - //app.$ui.actionList - } }); function constructList() {