From 21fc1e2832a091434d76deb2f09f42dd929acd83 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Mon, 15 Aug 2022 01:19:58 -0700 Subject: [PATCH] fix show craft menu button issue --- web/app/cad/craft/ui/HistoryTimeline.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/cad/craft/ui/HistoryTimeline.jsx b/web/app/cad/craft/ui/HistoryTimeline.jsx index eb10fe6f..a1b22acb 100644 --- a/web/app/cad/craft/ui/HistoryTimeline.jsx +++ b/web/app/cad/craft/ui/HistoryTimeline.jsx @@ -11,6 +11,7 @@ import {combine} from 'lstream'; import {EMPTY_OBJECT} from 'gems/objects'; import {aboveElement} from 'ui/positionUtils'; import {resolveAppearance} from "cad/craft/operationHelper"; +import {menuAboveElementHint} from "cad/dom/menu/menuUtils"; @connect(streams => combine(streams.craft.modifications, streams.operation.registry, streams.wizard.insertOperation) .map(([modifications, operationRegistry, insertOperationReq]) => ({ @@ -131,7 +132,7 @@ const HistoryItem = decoratorChain( s.index === index ? EMPTY_OBJECT : {index, locationHint: aboveElement(el)}) })) ) - ( +( // eslint-disable-line no-unexpected-multiline function HistoryItem({index, pointer, modification, getOperation, toggle, selected, disabled, inProgress}) { const operation = getOperation(modification.type); const appearance = resolveAppearance(operation, modification.params); @@ -143,7 +144,7 @@ function HistoryItem({index, pointer, modification, getOperation, toggle, select }); const AddButton = mapContext((ctx) => ({ - showCraftMenu: e => ctx.actionService.action.run(params, ctx, 'menu.craft') + showCraftMenu: e => ctx.actionService.run('menu.craft', menuAboveElementHint(e.currentTarget)) }))( function AddButton({showCraftMenu}) { return