Skip to content

Commit

Permalink
Merge pull request #3748 from inception-project/feature/3747-Tooltip-…
Browse files Browse the repository at this point in the history
…with-longer-text-on-annotations-truncated-in-sidebar

#3747 - Tooltip with longer text on annotations truncated in sidebar
  • Loading branch information
reckart authored Jan 26, 2023
2 parents 6b05764 + 3127b32 commit 2286df3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
$: begin = span.offsets[0][0]
$: end = span.offsets[0][1]
$: text = data.text.substring(begin, end).trim()
$: text = data.text.substring(begin, end).trim().replace(/\s+/g, ' ')
</script>

{#if text.length === 0}
<span class="text-muted">(empty span)</span>
{:else if text.length > 50}
<span title="{text.substring(0,1000)}">{text.substring(0, 50)}</span><span class="text-muted">…</span>
{:else}
<span>{text.substring(0, 50)+(text.length > 50 ? '' : '')}</span>
<span>{text}</span>
{/if}

<style>
Expand Down

0 comments on commit 2286df3

Please sign in to comment.