diff --git a/wwwroot/api/workspace_popup.dspy b/wwwroot/api/workspace_popup.dspy index a53cb1b..7f7b2c0 100644 --- a/wwwroot/api/workspace_popup.dspy +++ b/wwwroot/api/workspace_popup.dspy @@ -55,14 +55,7 @@ async with DBPools().sqlorContext(dbname) as sor: "css": "filler", "padding": "4px", "cheight": "100%" - }, - "binds": [{ - "wid": "self", - "event": "selected", - "actiontype": "script", - "target": "self", - "script": f"console.log('BIND FIRED');var tree=bricks.getWidgetById('ws_tree',bricks.app);if(!tree){{console.log('no tree');return;}}var nid=tree.selected_node.user_data.id;console.log('nid='+nid);var fp=bricks.getWidgetById('ws_files',bricks.app);if(fp){{fetch('{files_url}?id='+encodeURIComponent(nid)).then(function(r){{return r.json()}}).then(function(d){{console.log('loaded type='+d.widgettype);fp.dom_element.innerHTML='';bricks.widgetBuild(d,fp);console.log('ws_files innerHTML='+fp.dom_element.innerHTML.length);}});}}else{{console.log('no fp');}}" - }] + } }] }, { @@ -76,6 +69,13 @@ async with DBPools().sqlorContext(dbname) as sor: } } ] + }], + "binds": [{ + "wid": "ws_tree", + "event": "selected", + "actiontype": "script", + "target": "self", + "script": f"console.log('BIND FIRED');var tree=bricks.getWidgetById('ws_tree',bricks.app);if(!tree){{console.log('no tree');return;}}var nid=tree.selected_node.user_data.id;console.log('nid='+nid);var fp=bricks.getWidgetById('ws_files',bricks.app);if(fp){{fetch('{files_url}?id='+encodeURIComponent(nid)).then(function(r){{return r.json()}}).then(function(d){{console.log('loaded type='+d.widgettype);fp.dom_element.innerHTML='';bricks.widgetBuild(d,fp);console.log('ws_files innerHTML='+fp.dom_element.innerHTML.length);}});}}else{{console.log('no fp');}}" }] }