From cdefea265c2aecce8afcd0ccc7459ebbfb32d886 Mon Sep 17 00:00:00 2001 From: KeiferJu Date: Thu, 11 Jun 2020 11:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=96=E8=89=B2=E6=A1=86?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BD=8D=E7=BD=AE=E9=94=99=E4=B9=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/ColorPicker/ColorPicker.svelte | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 87d010c..8230b28 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "svelma-pro", "svelte": "src/index.js", "description": "Based on svelma project extension and modification", - "version": "1.2.1", + "version": "1.2.2", "author": "KeiferJu", "license": "MIT", "keywords": [ diff --git a/src/components/ColorPicker/ColorPicker.svelte b/src/components/ColorPicker/ColorPicker.svelte index 9e55bc8..58115de 100644 --- a/src/components/ColorPicker/ColorPicker.svelte +++ b/src/components/ColorPicker/ColorPicker.svelte @@ -19,13 +19,14 @@ let focusStatus = false function openChrome(event) { focusStatus = true + panelX = event.clientX - event.offsetX + panelY = event.clientY + transformX = event.target.offsetWidth + 5 + console.log(event) if (!active) { - panelX = event.clientX - event.offsetX - panelY = event.clientY - transformX = event.target.offsetWidth + 5 - setTimeout(()=>{ + setTimeout(() => { active = true - },100) + }, 100) } } @@ -65,16 +66,23 @@ {#if mode === 1}
- focusStatus = false} value={color} style="background: {color};" readonly /> + (focusStatus = false)} + value={color} + style="background: {color};" + readonly /> {#if active}
- +
{/if}
{:else} - + {/if}