fix: icons weren't remove on children

This commit is contained in:
skeris 2023-12-03 13:47:52 +03:00
parent ab4d99c3ba
commit 8772699ed6

@ -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')