From cb3357aeb8784fed580ff99da6fe2ca02f5e70bc Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:37:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E3=80=90=E6=B5=AE?= =?UTF-8?q?=E7=AA=97=E3=80=91-=E6=8B=96=E6=8B=BD=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E6=97=B6=E5=BA=94=E8=AF=A5=E8=B7=9F=E9=9A=8F=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E7=A7=BB=E5=8A=A8=20(#869)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/application/template/embed.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/application/template/embed.js b/apps/application/template/embed.js index 7006984dd..45c429949 100644 --- a/apps/application/template/embed.js +++ b/apps/application/template/embed.js @@ -87,11 +87,13 @@ const initChat=(root)=>{ closeviewport.classList.remove('maxkb-viewportnone') } } - if({{is_draggable}}){ - chat_button.addEventListener("dragend",(e)=>{ + const drag=(e)=>{ chat_button.style.top=(e.y-25)+'px' chat_button.style.left=(e.x-25)+'px' - }) + } + if({{is_draggable}}){ + chat_button.addEventListener("drag",drag) + chat_button.addEventListener("dragend",drag) } viewport.onclick=viewport_func closeviewport.onclick=viewport_func