Feat:只读模式下搜索时给当前匹配到的节点增加高亮效果
This commit is contained in:
parent
2d50106ce7
commit
e59d419708
@ -65,6 +65,9 @@ class Search {
|
|||||||
this.currentIndex = -1
|
this.currentIndex = -1
|
||||||
this.notResetSearchText = false
|
this.notResetSearchText = false
|
||||||
this.isSearching = false
|
this.isSearching = false
|
||||||
|
if (this.mindMap.opt.readonly) {
|
||||||
|
this.mindMap.renderer.closeHighlightNode()
|
||||||
|
}
|
||||||
this.emitEvent()
|
this.emitEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +99,10 @@ class Search {
|
|||||||
this.mindMap.execCommand('GO_TARGET_NODE', currentNode, () => {
|
this.mindMap.execCommand('GO_TARGET_NODE', currentNode, () => {
|
||||||
this.notResetSearchText = false
|
this.notResetSearchText = false
|
||||||
callback()
|
callback()
|
||||||
|
// 只读模式下节点无法激活,所以通过高亮的方式
|
||||||
|
if (this.mindMap.opt.readonly) {
|
||||||
|
this.mindMap.renderer.highlightNode(currentNode)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user