mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复【应用】浮窗模式嵌入第三方,开启可拖动位置,手机上无法拖动 (#893)
This commit is contained in:
parent
336a0dfebe
commit
8719f71efd
|
|
@ -87,13 +87,20 @@ const initChat=(root)=>{
|
|||
closeviewport.classList.remove('maxkb-viewportnone')
|
||||
}
|
||||
}
|
||||
const drag=(e)=>{
|
||||
chat_button.style.top=(e.y-25)+'px'
|
||||
chat_button.style.left=(e.x-25)+'px'
|
||||
}
|
||||
const drag=(e)=>{
|
||||
if (['touchmove','touchstart'].includes(e.type)) {
|
||||
chat_button.style.top=(e.touches[0].clientY-25)+'px'
|
||||
chat_button.style.left=(e.touches[0].clientX-25)+'px'
|
||||
} else {
|
||||
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)
|
||||
chat_button.addEventListener("touchstart",drag)
|
||||
chat_button.addEventListener("touchmove",drag)
|
||||
}
|
||||
viewport.onclick=viewport_func
|
||||
closeviewport.onclick=viewport_func
|
||||
|
|
|
|||
Loading…
Reference in New Issue