Skip to content

Commit

Permalink
修复拖动聊天图标容易中断问题 (#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglekang authored Apr 15, 2024
1 parent c314312 commit 97d097a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions projects/app/public/js/iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ function embedChatbot() {

chatBtnDown = true;
});
ChatBtn.addEventListener('mousemove', (e) => {

window.addEventListener('mousemove', (e) => {
e.stopPropagation();
if (!canDrag || !chatBtnDown) return;

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

Expand Down

0 comments on commit 97d097a

Please sign in to comment.