mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Feat:hide_text_edit事件增加被编辑节点的回调参数
This commit is contained in:
parent
d99a4dcc33
commit
6ffa4570d4
@ -286,7 +286,6 @@ export default class TextEdit {
|
||||
|
||||
// 隐藏文本编辑框
|
||||
hideEditTextBox() {
|
||||
this.currentNode = null
|
||||
if (this.mindMap.richText) {
|
||||
return this.mindMap.richText.hideEditText()
|
||||
}
|
||||
@ -305,8 +304,10 @@ export default class TextEdit {
|
||||
this.mindMap.emit(
|
||||
'hide_text_edit',
|
||||
this.textEditNode,
|
||||
this.renderer.activeNodeList
|
||||
this.renderer.activeNodeList,
|
||||
this.currentNode
|
||||
)
|
||||
this.currentNode = null
|
||||
this.textEditNode.style.display = 'none'
|
||||
this.textEditNode.innerHTML = ''
|
||||
this.textEditNode.style.fontFamily = 'inherit'
|
||||
|
||||
@ -344,7 +344,7 @@ class RichText {
|
||||
// }
|
||||
this.mindMap.render()
|
||||
})
|
||||
this.mindMap.emit('hide_text_edit', this.textEditNode, list)
|
||||
this.mindMap.emit('hide_text_edit', this.textEditNode, list, this.node)
|
||||
this.textEditNode.style.display = 'none'
|
||||
this.showTextEdit = false
|
||||
this.mindMap.emit('rich_text_selection_change', false)
|
||||
|
||||
@ -551,7 +551,7 @@ Listen to an event. Event list:
|
||||
| node_active | Node activation event | this (node instance), activeNodeList (current list of active nodes) |
|
||||
| expand_btn_click | Node expand or collapse event | this (node instance) |
|
||||
| before_show_text_edit | Event before node text edit box opens | |
|
||||
| hide_text_edit | Node text edit box close event | textEditNode (text edit box DOM node), activeNodeList (current list of active nodes) |
|
||||
| hide_text_edit | Node text edit box close event【The end of text editing for the associated line will also trigger this event, and there are no callback parameters at this time, so defensive programming is necessary】 | textEditNode (text edit box DOM node), activeNodeList (current list of active nodes) 、node(v0.10.2+, Node instance for current text editing) |
|
||||
| scale | Canvas zoom event | scale (zoom ratio) |
|
||||
| translate(v0.9.10+) | Canvas movement event | x(translate x)、y(translate y) |
|
||||
| node_img_dblclick(v0.2.15+) | Node image double-click event | this (node instance), e (event object) |
|
||||
|
||||
@ -1438,8 +1438,8 @@ poor performance and should be used sparingly.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>hide_text_edit</td>
|
||||
<td>Node text edit box close event</td>
|
||||
<td>textEditNode (text edit box DOM node), activeNodeList (current list of active nodes)</td>
|
||||
<td>Node text edit box close event【The end of text editing for the associated line will also trigger this event, and there are no callback parameters at this time, so defensive programming is necessary】</td>
|
||||
<td>textEditNode (text edit box DOM node), activeNodeList (current list of active nodes) 、node(v0.10.2+, Node instance for current text editing)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>scale</td>
|
||||
|
||||
@ -550,7 +550,7 @@ mindMap.setTheme('主题名称')
|
||||
| node_active | 节点激活事件 | this(节点实例)、activeNodeList(当前激活的所有节点列表) |
|
||||
| expand_btn_click | 节点展开或收缩事件 | this(节点实例) |
|
||||
| before_show_text_edit | 节点文本编辑框即将打开事件 | |
|
||||
| hide_text_edit | 节点文本编辑框关闭事件 | textEditNode(文本编辑框DOM节点)、activeNodeList(当前激活的所有节点列表) |
|
||||
| hide_text_edit | 节点文本编辑框关闭事件【关联线的文本编辑结束也会触发该事件,此时没有回调参数,所以需要做好防御性编程】 | textEditNode(文本编辑框DOM节点)、activeNodeList(当前激活的所有节点列表)、node(v0.10.2+,当前文本编辑的节点实例) |
|
||||
| scale | 画布放大缩小事件 | scale(缩放比例) |
|
||||
| translate(v0.9.10+) | 画布移动事件 | x(水平位移)、y(垂直位移) |
|
||||
| node_img_dblclick(v0.2.15+) | 节点内图片的双击事件 | this(节点实例)、e(事件对象) |
|
||||
|
||||
@ -1307,8 +1307,8 @@ mindMap.setTheme(<span class="hljs-string">'主题名称'</span>)
|
||||
</tr>
|
||||
<tr>
|
||||
<td>hide_text_edit</td>
|
||||
<td>节点文本编辑框关闭事件</td>
|
||||
<td>textEditNode(文本编辑框DOM节点)、activeNodeList(当前激活的所有节点列表)</td>
|
||||
<td>节点文本编辑框关闭事件【关联线的文本编辑结束也会触发该事件,此时没有回调参数,所以需要做好防御性编程】</td>
|
||||
<td>textEditNode(文本编辑框DOM节点)、activeNodeList(当前激活的所有节点列表)、node(v0.10.2+,当前文本编辑的节点实例)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>scale</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user