mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-24 20:13:00 +03:00
Merge branch 'main' of github.com:hcengineering/anticrm into main
This commit is contained in:
commit
bc407c4a82
@ -16,7 +16,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { IntlString } from '@anticrm/platform'
|
import type { IntlString } from '@anticrm/platform'
|
||||||
import type { TooltipAligment, AnySvelteComponent, AnyComponent } from '..'
|
import type { TooltipAligment, AnySvelteComponent, AnyComponent } from '..'
|
||||||
import { showTooltip } from '..'
|
import { tooltipstore as tooltip, showTooltip } from '..'
|
||||||
|
|
||||||
export let label: IntlString | undefined
|
export let label: IntlString | undefined
|
||||||
export let direction: TooltipAligment | undefined
|
export let direction: TooltipAligment | undefined
|
||||||
@ -24,13 +24,15 @@
|
|||||||
export let props: any | undefined = undefined
|
export let props: any | undefined = undefined
|
||||||
|
|
||||||
let triggerHTML: HTMLElement
|
let triggerHTML: HTMLElement
|
||||||
|
let shown: boolean = false
|
||||||
|
$: shown = ($tooltip.label || $tooltip.component) ? true : false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="tooltip-trigger"
|
class="tooltip-trigger"
|
||||||
bind:this={triggerHTML}
|
bind:this={triggerHTML}
|
||||||
on:mouseenter={() => {
|
on:mousemove={() => {
|
||||||
showTooltip(label, triggerHTML, direction, component, props)
|
if (!shown) showTooltip(label, triggerHTML, direction, component, props)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
Loading…
Reference in New Issue
Block a user