From 97d097a490283220079027156a1554c33ce1ea64 Mon Sep 17 00:00:00 2001 From: JINGLE Date: Mon, 15 Apr 2024 16:49:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=96=E5=8A=A8=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E5=9B=BE=E6=A0=87=E5=AE=B9=E6=98=93=E4=B8=AD=E6=96=AD?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#1194)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/app/public/js/iframe.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/projects/app/public/js/iframe.js b/projects/app/public/js/iframe.js index bf67dfb14..1bafd2dfa 100644 --- a/projects/app/public/js/iframe.js +++ b/projects/app/public/js/iframe.js @@ -76,7 +76,8 @@ function embedChatbot() { chatBtnDown = true; }); - ChatBtn.addEventListener('mousemove', (e) => { + + window.addEventListener('mousemove', (e) => { e.stopPropagation(); if (!canDrag || !chatBtnDown) return; @@ -86,12 +87,8 @@ function embedChatbot() { ChatBtn.style.transform = `translate3d(${transformX}px, ${transformY}px, 0)`; }); - ChatBtn.addEventListener('mouseup', (e) => { - chatBtnDragged = false; - chatBtnDown = false; - }); + window.addEventListener('mouseup', (e) => { - chatBtnDragged = false; chatBtnDown = false; });