This commit is contained in:
binary-husky
2024-02-06 17:59:09 +08:00
parent c27e559f10
commit 6c13bb7b46
2 changed files with 27 additions and 27 deletions

View File

@@ -242,14 +242,14 @@ function do_something_but_not_too_frequently(min_interval, func) {
// 现在就执行
setTimeout(() => {
func.apply(this, lastArgs);
}, 0);
}, 0);
} else if (!timeoutID) {
// 等一会执行
timeoutID = setTimeout(() => {
timeoutID = null;
lastInvocationTime = Date.now();
func.apply(this, lastArgs);
}, min_interval - (now - lastInvocationTime));
}, min_interval - (now - lastInvocationTime));
} else {
// 压根不执行
}
@@ -349,7 +349,7 @@ function get_elements(consider_state_panel = false) {
var chatbot_height = chatbot.style.height;
// 交换输入区位置,使得输入区始终可用
if (!swapped) {
if (panel1.top != 0 && (panel1.bottom + panel1.top) / 2 < 0) { swap_input_area(); }
if (panel1.top != 0 && (0.9 * panel1.bottom + 0.1 * panel1.top) < 0) { swap_input_area(); }
}
else if (swapped) {
if (panel2.top != 0 && panel2.top > 0) { swap_input_area(); }