This commit is contained in:
archer
2023-08-07 17:54:35 +08:00
parent a178de37de
commit a4c1a04900

View File

@@ -27,8 +27,6 @@ async function embedChatbot() {
'transition: all 0.2s ease-in-out 0s; left: unset; transform: scale(1); :hover {transform: scale(1.1);} display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; z-index: 9999;';
ChatBtnDiv.innerHTML = MessageIcon;
ChatBtn.appendChild(ChatBtnDiv);
const iframe = document.createElement('iframe');
iframe.allow = 'fullscreen;microphone';
iframe.title = 'FastGpt Chat Window';
@@ -40,10 +38,6 @@ async function embedChatbot() {
document.body.appendChild(iframe);
iframe.onload = () => {
document.body.appendChild(ChatBtn);
};
ChatBtn.addEventListener('click', function () {
const chatWindow = document.getElementById(chatWindowId);
@@ -57,5 +51,8 @@ async function embedChatbot() {
ChatBtnDiv.innerHTML = MessageIcon;
}
});
ChatBtn.appendChild(ChatBtnDiv);
document.body.appendChild(ChatBtn);
}
document.body.onload = embedChatbot;