Don't auto-adjust scroll height if not in viewport
This commit is contained in:
parent
5e44403346
commit
d75b30d51a
|
@ -712,6 +712,10 @@ function onChatChanged() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function adjustElementScrollHeight(){
|
function adjustElementScrollHeight(){
|
||||||
|
if (!$('.sd_settings').is(':visible')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
resetScrollHeight($('#sd_prompt_prefix'));
|
resetScrollHeight($('#sd_prompt_prefix'));
|
||||||
resetScrollHeight($('#sd_negative_prompt'));
|
resetScrollHeight($('#sd_negative_prompt'));
|
||||||
resetScrollHeight($('#sd_character_prompt'));
|
resetScrollHeight($('#sd_character_prompt'));
|
||||||
|
|
|
@ -292,6 +292,9 @@ export function throttle(func, limit = 300) {
|
||||||
* @returns {boolean} True if the element is in the viewport, false otherwise.
|
* @returns {boolean} True if the element is in the viewport, false otherwise.
|
||||||
*/
|
*/
|
||||||
export function isElementInViewport(el) {
|
export function isElementInViewport(el) {
|
||||||
|
if (!el) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (typeof jQuery === 'function' && el instanceof jQuery) {
|
if (typeof jQuery === 'function' && el instanceof jQuery) {
|
||||||
el = el[0];
|
el = el[0];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue