fix autoscrolling on browser zoom

when browser zoom is activated, our scrollposition can be a little bit off
increase the boundary by a few pixels (5px are ~1/3 of a line)
so that the auto-scrolling still works

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-09-30 14:04:39 +02:00 committed by Dietmar Maurer
parent ab277cb287
commit aa9607f128
2 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@ Ext.define('Proxmox.panel.JournalView', {
if (!livemode) {
setTimeout(function() { view.scrollTo(0, 0); }, 10);
} else if (view.scrollToEnd && scrollPos <= 0) {
} else if (view.scrollToEnd && scrollPos <= 5) {
setTimeout(function() { view.scrollTo(0, Infinity); }, 10);
} else if (!view.scrollToEnd && scrollPosTop < 20 * view.lineHeight) {
setTimeout(function() { view.scrollTo(0, (num * view.lineHeight) + scrollPosTop); }, 10);
@ -170,7 +170,7 @@ Ext.define('Proxmox.panel.JournalView', {
if (me.scrollPosTop() < 20*view.lineHeight) {
view.scrollToEnd = false;
view.loadTask.delay(200, undefined, undefined, [true, true]);
} else if (me.scrollPosBottom() <= 1) {
} else if (me.scrollPosBottom() <= 5) {
view.scrollToEnd = true;
}
},
@ -199,7 +199,7 @@ Ext.define('Proxmox.panel.JournalView', {
return;
}
if (me.scrollPosBottom() <= 1) {
if (me.scrollPosBottom() <= 5) {
view.loadTask.delay(200, undefined, undefined, [true, false]);
}
},

View File

@ -65,7 +65,7 @@ Ext.define('Proxmox.panel.LogView', {
content.update(text);
if (view.scrollToEnd && scrollPos <= 0) {
if (view.scrollToEnd && scrollPos <= 5) {
// we use setTimeout to work around scroll handling on touchscreens
setTimeout(function() { view.scrollTo(0, Infinity); }, 10);
}
@ -167,7 +167,7 @@ Ext.define('Proxmox.panel.LogView', {
return;
}
if (me.scrollPosBottom() <= 1) {
if (me.scrollPosBottom() <= 5) {
view.loadTask.delay(200);
}
},