Feat:插入新节点时去除延时开启节点编辑的逻辑

This commit is contained in:
街角小林 2024-05-31 16:55:02 +08:00
parent 67fec82c72
commit 25f0668a44
2 changed files with 6 additions and 8 deletions

View File

@ -136,9 +136,7 @@ class MindMap {
this.associativeLineDraw.addClass('smm-associative-line-container') this.associativeLineDraw.addClass('smm-associative-line-container')
} }
// 画布 // 画布
this.svg = SVG() this.svg = SVG().addTo(this.el).size(this.width, this.height)
.addTo(this.el)
.size(this.width, this.height)
// 容器 // 容器
this.draw = this.svg.group() this.draw = this.svg.group()

View File

@ -782,9 +782,9 @@ class Node {
if (this.nodeData.inserting) { if (this.nodeData.inserting) {
delete this.nodeData.inserting delete this.nodeData.inserting
this.active() this.active()
setTimeout(() => { // setTimeout(() => {
this.mindMap.emit('node_dblclick', this, null, true) this.mindMap.emit('node_dblclick', this, null, true)
}, 0) // }, 0)
} }
} }
@ -1192,7 +1192,7 @@ class Node {
...this.opt, ...this.opt,
uid: createUid() uid: createUid()
}) })
Object.keys(this).forEach((item) => { Object.keys(this).forEach(item => {
newNode[item] = this[item] newNode[item] = this[item]
}) })
return newNode return newNode