mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
优化:手动创建节点时立即聚焦
This commit is contained in:
@@ -694,7 +694,7 @@ class Node {
|
||||
if (this.mindMap.opt.readonly) {
|
||||
return
|
||||
}
|
||||
e.stopPropagation()
|
||||
e && e.stopPropagation()
|
||||
if (this.nodeData.data.isActive) {
|
||||
return
|
||||
}
|
||||
@@ -769,6 +769,12 @@ class Node {
|
||||
}
|
||||
}))
|
||||
}
|
||||
// 手动插入的节点立即获得焦点并且开启编辑模式
|
||||
if (this.nodeData.inserting) {
|
||||
delete this.nodeData.inserting
|
||||
this.active()
|
||||
this.mindMap.emit('node_dblclick', this)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -413,6 +413,7 @@ class Render {
|
||||
}
|
||||
let index = this.getNodeIndex(first)
|
||||
first.parent.nodeData.children.splice(index + 1, 0, {
|
||||
"inserting": true,
|
||||
"data": {
|
||||
"text": text,
|
||||
"expand": true
|
||||
@@ -438,6 +439,7 @@ class Render {
|
||||
}
|
||||
let text = node.isRoot ? '二级节点' : '分支主题'
|
||||
node.nodeData.children.push({
|
||||
"inserting": true,
|
||||
"data": {
|
||||
"text": text,
|
||||
"expand": true
|
||||
|
||||
Reference in New Issue
Block a user