From ebf7757dd2c979b5980d8aa0508bb466a91067fc Mon Sep 17 00:00:00 2001 From: p Date: Wed, 12 Aug 2026 17:00:04 +0800 Subject: [PATCH] fix: use getWidgetById instead of this in tree script --- wwwroot/api/workspace_popup.dspy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wwwroot/api/workspace_popup.dspy b/wwwroot/api/workspace_popup.dspy index 1d85753..caeb816 100644 --- a/wwwroot/api/workspace_popup.dspy +++ b/wwwroot/api/workspace_popup.dspy @@ -61,7 +61,7 @@ async with DBPools().sqlorContext(dbname) as sor: "event": "selected", "actiontype": "script", "target": "self", - "script": f"var nid=this.selected_node.user_data.id;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){{fp.dom_element.innerHTML='';bricks.widgetBuild(d,fp);}});" + "script": f"var tree=bricks.getWidgetById('ws_tree',bricks.app);var nid=tree.selected_node.user_data.id;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){{fp.dom_element.innerHTML='';bricks.widgetBuild(d,fp);}});" }] }] },