Commit 97d097a4 by JINGLE Committed by GitHub

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

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