From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 8729F62719 for ; Wed, 30 Sep 2020 14:05:10 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7A04A18AE1 for ; Wed, 30 Sep 2020 14:04:40 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id EA2A918AD9 for ; Wed, 30 Sep 2020 14:04:39 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B63474491E for ; Wed, 30 Sep 2020 14:04:39 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Wed, 30 Sep 2020 14:04:39 +0200 Message-Id: <20200930120439.18213-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.148 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.379 Envelope sender has no MX or A DNS records RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH widget-toolkit] fix autoscrolling on browser zoom X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 12:05:10 -0000 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 --- 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