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

View File

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