Spaces:
Sleeping
Sleeping
Keldos
commited on
Commit
•
f3c02b8
1
Parent(s):
a63e3c6
feat: 页面刷新时对话框滚动条自动定位至最下方
Browse files- assets/custom.js +5 -0
assets/custom.js
CHANGED
@@ -69,6 +69,7 @@ function gradioLoaded(mutations) {
|
|
69 |
if (!historyLoaded) {
|
70 |
loadHistoryHtml();
|
71 |
}
|
|
|
72 |
}
|
73 |
if (renderLatex) { // renderLatex 加载出来了没?
|
74 |
shouldRenderLatex = renderLatex.checked;
|
@@ -271,6 +272,10 @@ function setChatbotHeight() {
|
|
271 |
}
|
272 |
}
|
273 |
}
|
|
|
|
|
|
|
|
|
274 |
|
275 |
function addChuanhuButton(botElement) {
|
276 |
var rawMessage = null;
|
|
|
69 |
if (!historyLoaded) {
|
70 |
loadHistoryHtml();
|
71 |
}
|
72 |
+
setChatbotScroll();
|
73 |
}
|
74 |
if (renderLatex) { // renderLatex 加载出来了没?
|
75 |
shouldRenderLatex = renderLatex.checked;
|
|
|
272 |
}
|
273 |
}
|
274 |
}
|
275 |
+
function setChatbotScroll() {
|
276 |
+
var scrollHeight = chatbotWrap.scrollHeight;
|
277 |
+
chatbotWrap.scrollTo(0,scrollHeight)
|
278 |
+
}
|
279 |
|
280 |
function addChuanhuButton(botElement) {
|
281 |
var rawMessage = null;
|