Commit 97d097a4 by JINGLE Committed by GitHub

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

parent c314312a
...@@ -76,7 +76,8 @@ function embedChatbot() { ...@@ -76,7 +76,8 @@ function embedChatbot() {
chatBtnDown = true; chatBtnDown = true;
}); });
ChatBtn.addEventListener('mousemove', (e) => {
window.addEventListener('mousemove', (e) => {
e.stopPropagation(); e.stopPropagation();
if (!canDrag || !chatBtnDown) return; if (!canDrag || !chatBtnDown) return;
...@@ -86,12 +87,8 @@ function embedChatbot() { ...@@ -86,12 +87,8 @@ function embedChatbot() {
ChatBtn.style.transform = `translate3d(${transformX}px, ${transformY}px, 0)`; ChatBtn.style.transform = `translate3d(${transformX}px, ${transformY}px, 0)`;
}); });
ChatBtn.addEventListener('mouseup', (e) => {
chatBtnDragged = false;
chatBtnDown = false;
});
window.addEventListener('mouseup', (e) => { window.addEventListener('mouseup', (e) => {
chatBtnDragged = false;
chatBtnDown = false; chatBtnDown = false;
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment