mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Feat:同时激活多个节点时编辑某个节点的文本只对该节点生效
This commit is contained in:
@@ -334,15 +334,16 @@ export default class TextEdit {
|
||||
if (!this.showTextEdit) {
|
||||
return
|
||||
}
|
||||
this.renderer.activeNodeList.forEach(node => {
|
||||
let str = this.getEditText()
|
||||
this.mindMap.execCommand('SET_NODE_TEXT', node, str)
|
||||
if (node.isGeneralization) {
|
||||
// 概要节点
|
||||
node.generalizationBelongNode.updateGeneralization()
|
||||
}
|
||||
this.mindMap.render()
|
||||
})
|
||||
this.mindMap.execCommand(
|
||||
'SET_NODE_TEXT',
|
||||
this.currentNode,
|
||||
this.getEditText()
|
||||
)
|
||||
if (this.currentNode.isGeneralization) {
|
||||
// 概要节点
|
||||
this.currentNode.generalizationBelongNode.updateGeneralization()
|
||||
}
|
||||
this.mindMap.render()
|
||||
const currentNode = this.currentNode
|
||||
this.currentNode = null
|
||||
this.textEditNode.style.display = 'none'
|
||||
|
||||
@@ -388,8 +388,7 @@ class RichText {
|
||||
}
|
||||
let html = this.getEditText()
|
||||
html = this.sortHtmlNodeStyles(html)
|
||||
let list =
|
||||
nodes && nodes.length > 0 ? nodes : this.mindMap.renderer.activeNodeList
|
||||
const list = nodes && nodes.length > 0 ? nodes : [this.node]
|
||||
list.forEach(node => {
|
||||
this.mindMap.execCommand('SET_NODE_TEXT', node, html, true)
|
||||
// if (node.isGeneralization) {
|
||||
|
||||
Reference in New Issue
Block a user