mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 22:15:04 +02:00
fix: limit tooltip size in inbox (#7228)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
|
||||
const client = getClient()
|
||||
const limit = 300
|
||||
const tooltipLimit = 512
|
||||
|
||||
let isActionsOpened = false
|
||||
let person: WithLookup<Person> | undefined = undefined
|
||||
@@ -83,6 +84,14 @@
|
||||
} else {
|
||||
tooltipLabel = core.string.System
|
||||
}
|
||||
|
||||
function getTooltipText (markup: string): string {
|
||||
const text = markupToText(markup)
|
||||
if (text.length > tooltipLimit) {
|
||||
return text.substring(0, tooltipLimit) + '...'
|
||||
}
|
||||
return text
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
@@ -138,7 +147,7 @@
|
||||
<span
|
||||
class="textContent overflow-label font-normal"
|
||||
class:contentOnly={type === 'content-only'}
|
||||
use:tooltip={{ label: text ? getEmbeddedLabel(markupToText(text)) : intlLabel }}
|
||||
use:tooltip={{ label: text ? getEmbeddedLabel(getTooltipText(text)) : intlLabel }}
|
||||
>
|
||||
{#if intlLabel}
|
||||
<Label label={intlLabel} />
|
||||
|
||||
Reference in New Issue
Block a user