mirror of
https://github.com/lana-k/sqliteviz.git
synced 2026-11-04 00:39:24 +08:00
#142 improve tooltips
This commit is contained in:
@@ -10,4 +10,5 @@
|
||||
border-radius: var(--border-radius-medium);
|
||||
white-space: nowrap;
|
||||
z-index: 999;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
+5
-1
@@ -3,7 +3,8 @@ export default {
|
||||
return {
|
||||
tooltipStyle: {
|
||||
visibility: 'hidden'
|
||||
}
|
||||
},
|
||||
showTooltipTimeout: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -13,6 +14,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
showTooltip(e, tooltipPosition) {
|
||||
this.showTooltipTimeout = setTimeout(() => {
|
||||
const position = tooltipPosition
|
||||
? tooltipPosition.split('-')
|
||||
: ['top', 'right']
|
||||
@@ -32,8 +34,10 @@ export default {
|
||||
}
|
||||
|
||||
this.tooltipStyle.visibility = 'visible'
|
||||
}, 500)
|
||||
},
|
||||
hideTooltip() {
|
||||
this.showTooltipTimeout && clearTimeout(this.showTooltipTimeout)
|
||||
this.tooltipStyle.visibility = 'hidden'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user