Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
feat: 现在折叠状态下也可以添加子节点
Browse files Browse the repository at this point in the history
  • Loading branch information
hellowuxin committed May 14, 2021
1 parent d43e8dc commit b206658
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/Mindmap/data/ImData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ class ImData {

add (id: string, variable: string | Data): IsMdata {
const p = this.find(id)
if (p && !p.collapse) {
if (!p.children) { p.children = [] }
if (p) {
if (p.collapse) { this.expand(id) }
if (!p.rawData.children) { p.rawData.children = [] }
if (typeof variable === 'string') {
const name = variable
Expand Down Expand Up @@ -324,6 +324,7 @@ class ImData {
return m
}
}

return null
}

Expand Down
1 change: 0 additions & 1 deletion src/components/Mindmap/listener/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export const onContextmenu = (e: MouseEvent): void => {
const isRoot = classList.contains(style.root)
const collapseFlag = classList.contains(style['collapse'])
if (!classList.contains(style.selected)) { selectGNode(gNode as SVGGElement) }
ctm.addItem.value.disabled = collapseFlag
ctm.deleteItem.value.disabled = isRoot
ctm.cutItem.value.disabled = isRoot
ctm.deleteOneItem.value.disabled = isRoot
Expand Down

0 comments on commit b206658

Please sign in to comment.