From 8772699ed64980c9380b6d1745a8abaa6f78ef94 Mon Sep 17 00:00:00 2001 From: skeris Date: Sun, 3 Dec 2023 13:47:52 +0300 Subject: [PATCH] fix: icons weren't remove on children --- src/pages/Questions/BranchingMap/CsComponent.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Questions/BranchingMap/CsComponent.tsx b/src/pages/Questions/BranchingMap/CsComponent.tsx index a988b562..775ecbf1 100644 --- a/src/pages/Questions/BranchingMap/CsComponent.tsx +++ b/src/pages/Questions/BranchingMap/CsComponent.tsx @@ -226,6 +226,7 @@ export const CsComponent = ({ deleteNodes.forEach((nodeId) => {//Ноды cy?.remove(cy?.$("#" + nodeId)) + removeButtons(nodeId) updateQuestion(nodeId, question => { question.content.rule.parentId = "" question.content.rule.main = [] @@ -370,7 +371,7 @@ if (e.cy().data('firstNode') !== 'root') { if (e.cy().data('firstNode') === undefined) e.cy().data('firstNode','nonroot') const parent = e.cy().edges(`[target="${e.id()}"]`)[0].source() - const wing = (parent.data('children') === 1) ? 0 : parent.data('subtreeWidth') / 2 + const wing = (parent.data('children') === 1) ? 0 : parent.data('subtreeWidth') / 2 + 50 const lastOffset = parent.data('lastChild') const step = wing * 2 / (parent.data('children') - 1) //e.removeData('subtreeWidth')