mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
textEdit类增加isShowTextEdit方法判断当前是否处在节点编辑状态
This commit is contained in:
parent
4a2816fc75
commit
b950c2bfe9
@ -44,13 +44,10 @@ export default class KeyCommand {
|
||||
this.isInSvg = true
|
||||
})
|
||||
this.mindMap.on('svg_mouseleave', () => {
|
||||
if (this.mindMap.richText && this.mindMap.richText.showTextEdit) {
|
||||
return
|
||||
}
|
||||
if (this.mindMap.renderer.textEdit.isShowTextEdit()) return
|
||||
if (
|
||||
this.mindMap.renderer.textEdit.showTextEdit ||
|
||||
(this.mindMap.associativeLine &&
|
||||
this.mindMap.associativeLine.showTextEdit)
|
||||
this.mindMap.associativeLine &&
|
||||
this.mindMap.associativeLine.showTextEdit
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -276,9 +276,6 @@ class Render {
|
||||
})
|
||||
// 插入同级节点
|
||||
this.mindMap.keyCommand.addShortcut('Enter', () => {
|
||||
if (this.textEdit.showTextEdit) {
|
||||
return
|
||||
}
|
||||
this.mindMap.execCommand('INSERT_NODE')
|
||||
})
|
||||
// 插入父节点
|
||||
|
||||
@ -126,6 +126,14 @@ export default class TextEdit {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取当前文本编辑框是否处于显示状态,也就是是否处在文本编辑状态
|
||||
isShowTextEdit() {
|
||||
if (this.mindMap.richText) {
|
||||
return this.mindMap.richText.showTextEdit
|
||||
}
|
||||
return this.showTextEdit
|
||||
}
|
||||
|
||||
// 显示文本编辑框
|
||||
// isInserting:是否是刚创建的节点
|
||||
// isFromKeyDown:是否是在按键事件进入的编辑
|
||||
|
||||
Loading…
Reference in New Issue
Block a user