fix: 【应用】-浮窗框模式,拖拽浮窗入口图标, 图标会变大
This commit is contained in:
parent
8e1f676d82
commit
11bbbf6469
@ -64,6 +64,7 @@ const initChat=(root)=>{
|
|||||||
root.insertAdjacentHTML('beforeend',getChatContainerHtml('{{protocol}}','{{host}}','{{token}}','{{query}}'))
|
root.insertAdjacentHTML('beforeend',getChatContainerHtml('{{protocol}}','{{host}}','{{token}}','{{query}}'))
|
||||||
// 按钮元素
|
// 按钮元素
|
||||||
const chat_button=root.querySelector('.maxkb-chat-button')
|
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')
|
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.top=(e.y-25)+'px'
|
||||||
chat_button.style.left=(e.x-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}}){
|
if({{is_draggable}}){
|
||||||
|
console.dir(chat_button_img)
|
||||||
chat_button.addEventListener("drag",drag)
|
chat_button.addEventListener("drag",drag)
|
||||||
chat_button.addEventListener("dragover",(e)=>{
|
chat_button.addEventListener("dragover",(e)=>{
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user