修复拖动聊天图标容易中断问题 (#1194)

This commit is contained in:
JINGLE
2024-04-15 16:49:22 +08:00
committed by GitHub
parent c314312a57
commit 97d097a490

View File

@@ -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;
});