Updated the hover behaviour for bindings and added flags to stop empty sections from rendering
This commit is contained in:
parent
64382995ee
commit
447f45d71b
1 changed files with 13 additions and 14 deletions
|
@ -177,11 +177,17 @@
|
||||||
>
|
>
|
||||||
<Layout gap="S">
|
<Layout gap="S">
|
||||||
<div class="helper">
|
<div class="helper">
|
||||||
|
{#if hoverTarget.title}
|
||||||
<div class="helper__name">{hoverTarget.title}</div>
|
<div class="helper__name">{hoverTarget.title}</div>
|
||||||
|
{/if}
|
||||||
|
{#if hoverTarget.description}
|
||||||
<div class="helper__description">
|
<div class="helper__description">
|
||||||
{@html hoverTarget.description}
|
{@html hoverTarget.description}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
{#if hoverTarget.example}
|
||||||
<pre class="helper__example">{hoverTarget.example}</pre>
|
<pre class="helper__example">{hoverTarget.example}</pre>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
@ -237,11 +243,11 @@
|
||||||
class="binding"
|
class="binding"
|
||||||
on:mouseenter={e => {
|
on:mouseenter={e => {
|
||||||
popoverAnchor = e.target
|
popoverAnchor = e.target
|
||||||
if (!binding.name && !binding.description) {
|
if (!binding.description) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
hoverTarget = {
|
hoverTarget = {
|
||||||
title: binding.name,
|
title: binding.display.name || binding.fieldSchema.name,
|
||||||
description: binding.description,
|
description: binding.description,
|
||||||
}
|
}
|
||||||
popover.show()
|
popover.show()
|
||||||
|
@ -273,13 +279,6 @@
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if binding.description}
|
|
||||||
<br />
|
|
||||||
<div class="binding__description">
|
|
||||||
{binding.description || ""}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue