Feat:同时激活多个节点时编辑某个节点的文本只对该节点生效

This commit is contained in:
街角小林
2024-10-14 09:33:20 +08:00
parent ca5075d50c
commit ec6a40e381
2 changed files with 11 additions and 11 deletions

View File

@@ -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'

View File

@@ -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) {