Fix:修复富文本模式下选择了多个节点时修改样式时意外修改文本的问题
This commit is contained in:
parent
6105fd6e3d
commit
505622f3dc
@ -699,7 +699,7 @@ class Render {
|
|||||||
if (Object.keys(config).length > 0) {
|
if (Object.keys(config).length > 0) {
|
||||||
this.mindMap.richText.showEditText(node)
|
this.mindMap.richText.showEditText(node)
|
||||||
this.mindMap.richText.formatAllText(config)
|
this.mindMap.richText.formatAllText(config)
|
||||||
this.mindMap.richText.hideEditText()
|
this.mindMap.richText.hideEditText([node])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setNodeDataRender(node, data)
|
this.setNodeDataRender(node, data)
|
||||||
|
|||||||
@ -152,14 +152,15 @@ class RichText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 隐藏文本编辑控件,即完成编辑
|
// 隐藏文本编辑控件,即完成编辑
|
||||||
hideEditText() {
|
hideEditText(nodes) {
|
||||||
if (!this.showTextEdit) {
|
if (!this.showTextEdit) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let html = this.quill.container.firstChild.innerHTML
|
let html = this.quill.container.firstChild.innerHTML
|
||||||
// 去除最后的空行
|
// 去除最后的空行
|
||||||
html = html.replace(/<p><br><\/p>$/, '')
|
html = html.replace(/<p><br><\/p>$/, '')
|
||||||
this.mindMap.renderer.activeNodeList.forEach(node => {
|
let list = nodes && nodes.length > 0 ? nodes : this.mindMap.renderer.activeNodeList
|
||||||
|
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) {
|
||||||
// 概要节点
|
// 概要节点
|
||||||
@ -170,7 +171,7 @@ class RichText {
|
|||||||
this.mindMap.emit(
|
this.mindMap.emit(
|
||||||
'hide_text_edit',
|
'hide_text_edit',
|
||||||
this.textEditNode,
|
this.textEditNode,
|
||||||
this.mindMap.renderer.activeNodeList
|
list
|
||||||
)
|
)
|
||||||
this.textEditNode.style.display = 'none'
|
this.textEditNode.style.display = 'none'
|
||||||
this.showTextEdit = false
|
this.showTextEdit = false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user