mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Merge 3af0961a89 into 9eab537b2e
This commit is contained in:
commit
32211b57d6
@ -758,6 +758,47 @@ class AssociativeLine {
|
||||
this.mindMap.deleteEditNodeClass(ASSOCIATIVE_LINE_TEXT_EDIT_WRAP)
|
||||
this.unBindEvent()
|
||||
}
|
||||
|
||||
// Toggle visibility of all associative lines
|
||||
// Returns the new visibility state (true = visible, false = hidden)
|
||||
toggleAllLinesVisibility() {
|
||||
if (this._linesHidden) {
|
||||
this.showAllLines()
|
||||
return true
|
||||
} else {
|
||||
this.hideAllLines()
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Hide all associative lines and their labels
|
||||
hideAllLines() {
|
||||
this._linesHidden = true
|
||||
this.lineList.forEach(line => {
|
||||
line[0].hide() // path
|
||||
line[1].hide() // clickPath
|
||||
line[2].hide() // text
|
||||
})
|
||||
this.hideControls()
|
||||
this.mindMap.emit('associative_line_visibility_change', false)
|
||||
}
|
||||
|
||||
// Show all associative lines and their labels
|
||||
showAllLines() {
|
||||
this._linesHidden = false
|
||||
this.lineList.forEach(line => {
|
||||
line[0].show() // path
|
||||
line[1].show() // clickPath
|
||||
line[2].show() // text
|
||||
})
|
||||
this.showControls()
|
||||
this.mindMap.emit('associative_line_visibility_change', true)
|
||||
}
|
||||
|
||||
// Get current visibility state
|
||||
getLinesVisibility() {
|
||||
return !this._linesHidden
|
||||
}
|
||||
}
|
||||
|
||||
AssociativeLine.instanceName = 'associativeLine'
|
||||
|
||||
@ -216,7 +216,9 @@ export default {
|
||||
downloadClient: 'Download client',
|
||||
site: 'Official website',
|
||||
current: 'Current:',
|
||||
downloadDesc: 'You can download it from the following address:'
|
||||
downloadDesc: 'You can download it from the following address:',
|
||||
showAssociativeLines: 'Show associative lines',
|
||||
hideAssociativeLines: 'Hide associative lines'
|
||||
},
|
||||
nodeHyperlink: {
|
||||
title: 'Link',
|
||||
|
||||
@ -210,7 +210,9 @@ export default {
|
||||
downloadClient: '下载客户端',
|
||||
site: '官方网站',
|
||||
current: '当前:',
|
||||
downloadDesc: '可从如下地址下载:'
|
||||
downloadDesc: '可从如下地址下载:',
|
||||
showAssociativeLines: '显示关联线',
|
||||
hideAssociativeLines: '隐藏关联线'
|
||||
},
|
||||
nodeHyperlink: {
|
||||
title: '超链接',
|
||||
|
||||
@ -43,6 +43,23 @@
|
||||
<div class="btn iconfont icondaohang1" @click="toggleMiniMap"></div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="item">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="
|
||||
showAssociativeLines
|
||||
? $t('navigatorToolbar.hideAssociativeLines')
|
||||
: $t('navigatorToolbar.showAssociativeLines')
|
||||
"
|
||||
placement="top"
|
||||
>
|
||||
<div
|
||||
class="btn iconfont iconlianjiexian"
|
||||
:style="{ opacity: showAssociativeLines ? 1 : 0.4 }"
|
||||
@click="toggleAssociativeLines"
|
||||
></div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="item">
|
||||
<!-- <el-switch
|
||||
v-model="isReadonly"
|
||||
@ -156,7 +173,8 @@ export default {
|
||||
version: pkg.version,
|
||||
langList,
|
||||
lang: '',
|
||||
openMiniMap: false
|
||||
openMiniMap: false,
|
||||
showAssociativeLines: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -245,6 +263,12 @@ export default {
|
||||
a.click()
|
||||
},
|
||||
|
||||
toggleAssociativeLines() {
|
||||
if (this.mindMap && this.mindMap.associativeLine) {
|
||||
this.showAssociativeLines = this.mindMap.associativeLine.toggleAllLinesVisibility()
|
||||
}
|
||||
},
|
||||
|
||||
backToRoot() {
|
||||
this.mindMap.renderer.setRootNodeCenter()
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user