From 6bf394fde57d51a31263f221900bf2ca9de9522e Mon Sep 17 00:00:00 2001 From: cmack Date: Fri, 3 Jul 2020 16:16:38 +0100 Subject: [PATCH] Minor bug fixes --- .../Colorpicker/components/Colorpicker.svelte | 2 +- .../components/Colorpreview.svelte | 2 - .../Colorpicker/components/Swatch.svelte | 81 ++++++++++--------- 3 files changed, 42 insertions(+), 43 deletions(-) diff --git a/packages/builder/src/components/userInterface/Colorpicker/components/Colorpicker.svelte b/packages/builder/src/components/userInterface/Colorpicker/components/Colorpicker.svelte index 254dc1f288..7fa536a474 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/components/Colorpicker.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/components/Colorpicker.svelte @@ -154,7 +154,7 @@ } function removeSwatch(idx) { - let removedSwatch = swatches.splice(idx, 1); + let [removedSwatch] = swatches.splice(idx, 1); swatches = swatches; dispatch("removeswatch", removedSwatch); if (swatchesSetFromLocalStore) { diff --git a/packages/builder/src/components/userInterface/Colorpicker/components/Colorpreview.svelte b/packages/builder/src/components/userInterface/Colorpicker/components/Colorpreview.svelte index f3ab6f6f22..2d9426fbae 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/components/Colorpreview.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/components/Colorpreview.svelte @@ -114,8 +114,6 @@ cursor: pointer; border-radius: 3px; border: 1px solid #dedada; - position: absolute; - left: 110px; } .preview-error { diff --git a/packages/builder/src/components/userInterface/Colorpicker/components/Swatch.svelte b/packages/builder/src/components/userInterface/Colorpicker/components/Swatch.svelte index 11bd4d3821..e56e6d0b6f 100644 --- a/packages/builder/src/components/userInterface/Colorpicker/components/Swatch.svelte +++ b/packages/builder/src/components/userInterface/Colorpicker/components/Swatch.svelte @@ -1,39 +1,15 @@ -
- -
dispatch('click') }} - in:fade - title={color} - class="swatch" - style={`background: ${color};`} - on:click|self - on:mouseover={() => (hovered = true)} - on:mouseleave={() => (hovered = false)}> - {#if hovered} -
dispatch('removeswatch')}> - dispatch('removeswatch')}>× -
- {/if} -
-
-
- + +
+ +
dispatch('click') }} + in:fade + title={color} + class="swatch" + style={`background: ${color};`} + on:mouseover={() => (hovered = true)} + on:mouseleave={() => (hovered = false)} + on:click|self> + {#if hovered} + dispatch('removeswatch')} /> + {/if} +
+
+