From 11bbbf64690b7782adb106c59b63603cf3e10dcb Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Mon, 23 Sep 2024 18:25:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90=E5=BA=94=E7=94=A8=E3=80=91-?= =?UTF-8?q?=E6=B5=AE=E7=AA=97=E6=A1=86=E6=A8=A1=E5=BC=8F=EF=BC=8C=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E6=B5=AE=E7=AA=97=E5=85=A5=E5=8F=A3=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=EF=BC=8C=20=E5=9B=BE=E6=A0=87=E4=BC=9A=E5=8F=98=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/application/template/embed.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/application/template/embed.js b/apps/application/template/embed.js index e5058836a..5dca36dfa 100644 --- a/apps/application/template/embed.js +++ b/apps/application/template/embed.js @@ -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()