Feat:1.节点实例新增高亮和取消高亮的方法;2.调整只读模式搜索高亮节点的方式;Fix:修复只读模式搜索高亮节点时收起节点高亮框未消失的问题;
This commit is contained in:
parent
7999b5c260
commit
403aae4b3d
@ -346,7 +346,7 @@ export const cssContent = `
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.smm-node.active .smm-hover-node{
|
.smm-node.active .smm-hover-node, .smm-node-highlight .smm-hover-node{
|
||||||
display: block;
|
display: block;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
stroke-width: 2;
|
stroke-width: 2;
|
||||||
|
|||||||
@ -1052,6 +1052,16 @@ class Node {
|
|||||||
height: height * scaleY
|
height: height * scaleY
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 高亮节点
|
||||||
|
highlight() {
|
||||||
|
if (this.group) this.group.addClass('smm-node-highlight')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消高亮节点
|
||||||
|
closeHighlight() {
|
||||||
|
if (this.group) this.group.removeClass('smm-node-highlight')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Node
|
export default Node
|
||||||
|
|||||||
@ -69,14 +69,14 @@ class Search {
|
|||||||
// 结束搜索
|
// 结束搜索
|
||||||
endSearch() {
|
endSearch() {
|
||||||
if (!this.isSearching) return
|
if (!this.isSearching) return
|
||||||
|
if (this.mindMap.opt.readonly && this.matchNodeList[this.currentIndex]) {
|
||||||
|
this.matchNodeList[this.currentIndex].closeHighlight()
|
||||||
|
}
|
||||||
this.searchText = ''
|
this.searchText = ''
|
||||||
this.matchNodeList = []
|
this.matchNodeList = []
|
||||||
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()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ class Search {
|
|||||||
callback()
|
callback()
|
||||||
// 只读模式下节点无法激活,所以通过高亮的方式
|
// 只读模式下节点无法激活,所以通过高亮的方式
|
||||||
if (this.mindMap.opt.readonly) {
|
if (this.mindMap.opt.readonly) {
|
||||||
this.mindMap.renderer.highlightNode(currentNode)
|
currentNode.highlight()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user