mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
More robust autoscrolling (attempt)
This commit is contained in:
parent
03dc69edc5
commit
e2fddd9584
@ -113,7 +113,7 @@ let isScrolled = false;
|
|||||||
|
|
||||||
targetElement.addEventListener('scroll', function() {
|
targetElement.addEventListener('scroll', function() {
|
||||||
let diff = targetElement.scrollHeight - targetElement.clientHeight;
|
let diff = targetElement.scrollHeight - targetElement.clientHeight;
|
||||||
if(Math.abs(targetElement.scrollTop - diff) <= 1 || diff == 0) {
|
if(Math.abs(targetElement.scrollTop - diff) <= 10 || diff == 0) {
|
||||||
isScrolled = false;
|
isScrolled = false;
|
||||||
} else {
|
} else {
|
||||||
isScrolled = true;
|
isScrolled = true;
|
||||||
@ -161,7 +161,7 @@ let notebookScrolled = false;
|
|||||||
|
|
||||||
notebookElement.addEventListener('scroll', function() {
|
notebookElement.addEventListener('scroll', function() {
|
||||||
let diff = notebookElement.scrollHeight - notebookElement.clientHeight;
|
let diff = notebookElement.scrollHeight - notebookElement.clientHeight;
|
||||||
if(Math.abs(notebookElement.scrollTop - diff) <= 1 || diff == 0) {
|
if(Math.abs(notebookElement.scrollTop - diff) <= 10 || diff == 0) {
|
||||||
notebookScrolled = false;
|
notebookScrolled = false;
|
||||||
} else {
|
} else {
|
||||||
notebookScrolled = true;
|
notebookScrolled = true;
|
||||||
@ -186,7 +186,7 @@ let defaultScrolled = false;
|
|||||||
|
|
||||||
defaultElement.addEventListener('scroll', function() {
|
defaultElement.addEventListener('scroll', function() {
|
||||||
let diff = defaultElement.scrollHeight - defaultElement.clientHeight;
|
let diff = defaultElement.scrollHeight - defaultElement.clientHeight;
|
||||||
if(Math.abs(defaultElement.scrollTop - diff) <= 1 || diff == 0) {
|
if(Math.abs(defaultElement.scrollTop - diff) <= 10 || diff == 0) {
|
||||||
defaultScrolled = false;
|
defaultScrolled = false;
|
||||||
} else {
|
} else {
|
||||||
defaultScrolled = true;
|
defaultScrolled = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user