* [pve-devel] [PATCH widget-toolkit] panel/JournalView: fix flickering in journal livemode
@ 2021-06-22 9:57 Dominik Csapak
2021-06-22 12:11 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2021-06-22 9:57 UTC (permalink / raw)
To: pve-devel
it seems that something changed in extjs 7 which does not quite
restore the correct scroll position when the identical content is set
on a component. this means that sometimes, we update the text
with the identical one, but the scroll position is now off, only
to scroll back to the bottom
this causes a flickering everytime we do the api call.
instead, only update the component when the content really changed.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/panel/JournalView.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/panel/JournalView.js b/src/panel/JournalView.js
index 692f241..f672be1 100644
--- a/src/panel/JournalView.js
+++ b/src/panel/JournalView.js
@@ -77,6 +77,8 @@ Ext.define('Proxmox.panel.JournalView', {
let num = lines.length;
let text = lines.map(Ext.htmlEncode).join('<br>');
+ let contentChanged = true;
+
if (!livemode) {
if (num) {
view.content = text;
@@ -89,6 +91,8 @@ Ext.define('Proxmox.panel.JournalView', {
view.content = view.content ? text + '<br>' + view.content : text;
} else if (!top && num) {
view.content = view.content ? view.content + '<br>' + text : text;
+ } else {
+ contentChanged = false;
}
// update cursors
@@ -101,7 +105,9 @@ Ext.define('Proxmox.panel.JournalView', {
}
}
- contentEl.update(view.content);
+ if (contentChanged) {
+ contentEl.update(view.content);
+ }
me.updateScroll(livemode, num, scrollPos, scrollPosTop);
},
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH widget-toolkit] panel/JournalView: fix flickering in journal livemode
2021-06-22 9:57 [pve-devel] [PATCH widget-toolkit] panel/JournalView: fix flickering in journal livemode Dominik Csapak
@ 2021-06-22 12:11 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-06-22 12:11 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
On 22.06.21 11:57, Dominik Csapak wrote:
> it seems that something changed in extjs 7 which does not quite
> restore the correct scroll position when the identical content is set
> on a component. this means that sometimes, we update the text
> with the identical one, but the scroll position is now off, only
> to scroll back to the bottom
>
> this causes a flickering everytime we do the api call.
>
> instead, only update the component when the content really changed.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/panel/JournalView.js | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-22 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 9:57 [pve-devel] [PATCH widget-toolkit] panel/JournalView: fix flickering in journal livemode Dominik Csapak
2021-06-22 12:11 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox