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) { if (!this.showTextEdit) {
return return
} }
this.renderer.activeNodeList.forEach(node => { this.mindMap.execCommand(
let str = this.getEditText() 'SET_NODE_TEXT',
this.mindMap.execCommand('SET_NODE_TEXT', node, str) this.currentNode,
if (node.isGeneralization) { this.getEditText()
// 概要节点 )
node.generalizationBelongNode.updateGeneralization() if (this.currentNode.isGeneralization) {
} // 概要节点
this.mindMap.render() this.currentNode.generalizationBelongNode.updateGeneralization()
}) }
this.mindMap.render()
const currentNode = this.currentNode const currentNode = this.currentNode
this.currentNode = null this.currentNode = null
this.textEditNode.style.display = 'none' this.textEditNode.style.display = 'none'

View File

@ -388,8 +388,7 @@ class RichText {
} }
let html = this.getEditText() let html = this.getEditText()
html = this.sortHtmlNodeStyles(html) html = this.sortHtmlNodeStyles(html)
let list = const list = nodes && nodes.length > 0 ? nodes : [this.node]
nodes && nodes.length > 0 ? nodes : this.mindMap.renderer.activeNodeList
list.forEach(node => { list.forEach(node => {
this.mindMap.execCommand('SET_NODE_TEXT', node, html, true) this.mindMap.execCommand('SET_NODE_TEXT', node, html, true)
// if (node.isGeneralization) { // if (node.isGeneralization) {