Spaces:
Build error
Build error
Delete handleAutoScrollChat.js
Browse files- handleAutoScrollChat.js +0 -18
handleAutoScrollChat.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
| 1 |
-
function Scrolldown() {
|
| 2 |
-
let targetNode = document.querySelector('#chatbox-container');
|
| 3 |
-
|
| 4 |
-
if (!targetNode) {
|
| 5 |
-
console.error('Chat container not found');
|
| 6 |
-
return;
|
| 7 |
-
}
|
| 8 |
-
|
| 9 |
-
const config = { childList: true, subtree: true };
|
| 10 |
-
|
| 11 |
-
const callback = (mutationList, observer) => {
|
| 12 |
-
targetNode.scrollTop = targetNode.scrollHeight;
|
| 13 |
-
};
|
| 14 |
-
|
| 15 |
-
const observer = new MutationObserver(callback);
|
| 16 |
-
|
| 17 |
-
observer.observe(targetNode, config);
|
| 18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|