From 7f26e184a1ba4f102fad17cb771675b6d3c9dbdb Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Sat, 24 Dec 2022 00:37:51 -0800 Subject: [PATCH] Webclient: Fix inspect action context menu https://github.com/arianne/stendhal/issues/254 --- srcjs/stendhal/ui/dialog/ActionContextMenu.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/srcjs/stendhal/ui/dialog/ActionContextMenu.ts b/srcjs/stendhal/ui/dialog/ActionContextMenu.ts index 2cfeecfbe83..7e1bca5a5ae 100644 --- a/srcjs/stendhal/ui/dialog/ActionContextMenu.ts +++ b/srcjs/stendhal/ui/dialog/ActionContextMenu.ts @@ -81,8 +81,13 @@ export class ActionContextMenu extends Component { if (marauroa.me["adminlevel"] && marauroa.me["adminlevel"] >= 600) { actions.push({ title: "(*) Inspect", - action: function(entity: object) { - console.log(entity); + action: function(entity: any) { + const action = {"type": "inspect"} as {[key: string]: string}; + if (entity.hasOwnProperty("id")) { + action["target"] = "#" + entity["id"]; + } + + marauroa.clientFramework.sendAction(action); } }); actions.push({