mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-12 04:37:44 +02:00
TSK-1089: Proper Recruit Archive (#2952)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { navigate, parseLocation } from '@hcengineering/ui'
|
||||
import { closePopup, closeTooltip, navigate, parseLocation } from '@hcengineering/ui'
|
||||
|
||||
export let href: string | undefined
|
||||
export let disableClick = false
|
||||
@@ -24,12 +24,17 @@
|
||||
|
||||
function clickHandler (e: MouseEvent) {
|
||||
if (disableClick) return
|
||||
|
||||
if (onClick) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
onClick(e)
|
||||
} else if (href !== undefined) {
|
||||
if (e.metaKey || e.ctrlKey) return
|
||||
|
||||
// we need to close popups and tooltips
|
||||
closePopup()
|
||||
closeTooltip()
|
||||
try {
|
||||
const url = new URL(href)
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ const emptyTooltip: LabelAndProps = {
|
||||
let storedValue: LabelAndProps = emptyTooltip
|
||||
export const tooltipstore = writable<LabelAndProps>(emptyTooltip)
|
||||
|
||||
let toHandler: any
|
||||
export function tooltip (node: HTMLElement, options?: LabelAndProps): any {
|
||||
let toHandler: any
|
||||
if (options === undefined) {
|
||||
return {}
|
||||
}
|
||||
@@ -80,6 +80,7 @@ export function showTooltip (
|
||||
}
|
||||
|
||||
export function closeTooltip (): void {
|
||||
clearTimeout(toHandler)
|
||||
storedValue = emptyTooltip
|
||||
tooltipstore.set(emptyTooltip)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user