Skip to content

Commit

Permalink
#3747 - Tooltip with longer text on annotations truncated in sidebar
Browse files Browse the repository at this point in the history
- Display a tooltip for long annotations when hovering with the mouse over the covered text in the annotation sidebar
  • Loading branch information
reckart committed Jan 26, 2023
1 parent d9b5570 commit f9c7350
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 f9c7350

Please sign in to comment.