mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 09:43:10 +00:00
fix: 【应用】- 嵌入第三方的窗口,点击 X 关闭窗口后,在点击入口无法打开小窗口,只能刷新页面。
This commit is contained in:
parent
de920a6a44
commit
0e3f68db7f
|
|
@ -68,30 +68,13 @@ function embedChatbot() {
|
|||
cursor: pointer;
|
||||
`
|
||||
close_button.onclick = () => {
|
||||
document.body.removeChild(chat_container)
|
||||
chat_button.style['display']='block'
|
||||
chat_container.style['display']='none'
|
||||
}
|
||||
|
||||
chat_container.append(close_button)
|
||||
document.body.append(chat_container)
|
||||
let is_404=false
|
||||
chat_button.onclick = ($event) => {
|
||||
if( chat_container.style['display']=='block'){
|
||||
chat_container.style['display']='none'
|
||||
} else {
|
||||
if(auth(t.token,t.protocol, t.host)){
|
||||
if(is_404){
|
||||
document.body.removeChild(chat_container)
|
||||
document.body.append(chat_container)
|
||||
|
||||
is_404=false
|
||||
}
|
||||
chat_container.style['display']='block'
|
||||
|
||||
}else{
|
||||
is_404=true
|
||||
}
|
||||
}
|
||||
chat_container.style['display']=chat_container.style['display']=='block'?'none':'block'
|
||||
}
|
||||
sty = document.createElement('style')
|
||||
sty.innerText = ` #chat_container {
|
||||
|
|
|
|||
Loading…
Reference in New Issue