From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] fix autoscrolling on browser zoom
Date: Wed, 30 Sep 2020 14:04:39 +0200 [thread overview]
Message-ID: <20200930120439.18213-1-d.csapak@proxmox.com> (raw)
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>
---
src/panel/JournalView.js | 6 +++---
src/panel/LogView.js | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/panel/JournalView.js b/src/panel/JournalView.js
index b81cc45..692f241 100644
--- a/src/panel/JournalView.js
+++ b/src/panel/JournalView.js
@@ -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]);
}
},
diff --git a/src/panel/LogView.js b/src/panel/LogView.js
index 1ce83bc..1772737 100644
--- a/src/panel/LogView.js
+++ b/src/panel/LogView.js
@@ -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);
}
},
--
2.20.1
next reply other threads:[~2020-09-30 12:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 12:04 Dominik Csapak [this message]
2020-10-01 4:11 ` [pve-devel] applied: " Dietmar Maurer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200930120439.18213-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal