fix: 修复【浮窗】-拖拽机器人时应该跟随鼠标移动 (#869)

This commit is contained in:
shaohuzhang1 2024-07-25 15:37:58 +08:00 committed by GitHub
parent da11d771d7
commit cb3357aeb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,11 +87,13 @@ const initChat=(root)=>{
closeviewport.classList.remove('maxkb-viewportnone')
}
}
if({{is_draggable}}){
chat_button.addEventListener("dragend",(e)=>{
const drag=(e)=>{
chat_button.style.top=(e.y-25)+'px'
chat_button.style.left=(e.x-25)+'px'
})
}
if({{is_draggable}}){
chat_button.addEventListener("drag",drag)
chat_button.addEventListener("dragend",drag)
}
viewport.onclick=viewport_func
closeviewport.onclick=viewport_func