fix: 【应用】-浮窗框模式,拖拽浮窗入口图标, 图标会变大

This commit is contained in:
shaohuzhang1 2024-09-23 18:25:25 +08:00 committed by shaohuzhang1
parent 8e1f676d82
commit 11bbbf6469

View File

@ -64,6 +64,7 @@ const initChat=(root)=>{
root.insertAdjacentHTML('beforeend',getChatContainerHtml('{{protocol}}','{{host}}','{{token}}','{{query}}'))
// 按钮元素
const chat_button=root.querySelector('.maxkb-chat-button')
const chat_button_img=root.querySelector('.maxkb-chat-button > img')
// 对话框元素
const chat_container=root.querySelector('#maxkb-chat-container')
@ -95,8 +96,11 @@ const initChat=(root)=>{
chat_button.style.top=(e.y-25)+'px'
chat_button.style.left=(e.x-25)+'px'
}
chat_button.style.width =chat_button_img.naturalWidth+'px'
chat_button.style.height =chat_button_img.naturalHeight+'px'
}
if({{is_draggable}}){
console.dir(chat_button_img)
chat_button.addEventListener("drag",drag)
chat_button.addEventListener("dragover",(e)=>{
e.preventDefault()