Add fixed setting to allow tooltip to be permanently rendered
This commit is contained in:
parent
35150af784
commit
4129f166e6
|
@ -22,12 +22,15 @@
|
||||||
export let position = TooltipPosition.Top
|
export let position = TooltipPosition.Top
|
||||||
export let type = TooltipType.Default
|
export let type = TooltipType.Default
|
||||||
export let text = ""
|
export let text = ""
|
||||||
|
export let fixed = false
|
||||||
|
|
||||||
let wrapper
|
let wrapper
|
||||||
let visible = false
|
let hovered = false
|
||||||
let left = 0
|
let left = 0
|
||||||
let top = 0
|
let top = 0
|
||||||
|
|
||||||
|
$: visible = hovered || fixed
|
||||||
|
|
||||||
const show = () => {
|
const show = () => {
|
||||||
const node = wrapper?.children?.[0]
|
const node = wrapper?.children?.[0]
|
||||||
if (!node) {
|
if (!node) {
|
||||||
|
@ -51,10 +54,10 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
visible = true
|
hovered = true
|
||||||
}
|
}
|
||||||
const hide = () => {
|
const hide = () => {
|
||||||
visible = false
|
hovered = false
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue