From 7903306709f1d7f2f8941986ae805a6cbd110232 Mon Sep 17 00:00:00 2001 From: Dean Date: Wed, 24 Aug 2022 12:36:58 +0100 Subject: [PATCH] Updated the hover behaviour for bindings and added flags to stop empty sections from rendering --- .../common/bindings/BindingPanel.svelte | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index 63d8638bfe..959a565542 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -177,11 +177,17 @@ >
-
{hoverTarget.title}
-
- {@html hoverTarget.description} -
-
{hoverTarget.example}
+ {#if hoverTarget.title} +
{hoverTarget.title}
+ {/if} + {#if hoverTarget.description} +
+ {@html hoverTarget.description} +
+ {/if} + {#if hoverTarget.example} +
{hoverTarget.example}
+ {/if}
@@ -237,11 +243,11 @@ class="binding" on:mouseenter={e => { popoverAnchor = e.target - if (!binding.name && !binding.description) { + if (!binding.description) { return } hoverTarget = { - title: binding.name, + title: binding.display.name || binding.fieldSchema.name, description: binding.description, } popover.show() @@ -273,13 +279,6 @@ {/if} - - {#if binding.description} -
-
- {binding.description || ""} -
- {/if} {/each}