perf: Team org ui (#3499)

* perf: org ui

* perf: org ui
This commit is contained in:
Archer
2024-12-30 20:49:11 +08:00
committed by archer
parent 1fc77a126a
commit efecfd44c3
21 changed files with 505 additions and 563 deletions

View File

@@ -44,6 +44,21 @@ function embedChatbot() {
document.body.appendChild(iframe);
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === 'attributes' && mutation.attributeName === 'data-bot-src') {
const newBotSrc = script.getAttribute('data-bot-src');
if (newBotSrc) {
iframe.src = newBotSrc;
}
}
});
});
observer.observe(script, {
attributes: true,
attributeFilter: ['data-bot-src']
});
let chatBtnDragged = false;
let chatBtnDown = false;
let chatBtnMouseX;
@@ -96,3 +111,4 @@ function embedChatbot() {
document.body.appendChild(ChatBtn);
}
window.addEventListener('load', embedChatbot);