mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-06-27 13:45:28 +00:00
panel/JournalView: fix flickering in journal livemode
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>
This commit is contained in:
parent
f869d73e50
commit
17c320c831
@ -77,6 +77,8 @@ Ext.define('Proxmox.panel.JournalView', {
|
|||||||
let num = lines.length;
|
let num = lines.length;
|
||||||
let text = lines.map(Ext.htmlEncode).join('<br>');
|
let text = lines.map(Ext.htmlEncode).join('<br>');
|
||||||
|
|
||||||
|
let contentChanged = true;
|
||||||
|
|
||||||
if (!livemode) {
|
if (!livemode) {
|
||||||
if (num) {
|
if (num) {
|
||||||
view.content = text;
|
view.content = text;
|
||||||
@ -89,6 +91,8 @@ Ext.define('Proxmox.panel.JournalView', {
|
|||||||
view.content = view.content ? text + '<br>' + view.content : text;
|
view.content = view.content ? text + '<br>' + view.content : text;
|
||||||
} else if (!top && num) {
|
} else if (!top && num) {
|
||||||
view.content = view.content ? view.content + '<br>' + text : text;
|
view.content = view.content ? view.content + '<br>' + text : text;
|
||||||
|
} else {
|
||||||
|
contentChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update cursors
|
// update cursors
|
||||||
@ -101,7 +105,9 @@ Ext.define('Proxmox.panel.JournalView', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (contentChanged) {
|
||||||
contentEl.update(view.content);
|
contentEl.update(view.content);
|
||||||
|
}
|
||||||
|
|
||||||
me.updateScroll(livemode, num, scrollPos, scrollPosTop);
|
me.updateScroll(livemode, num, scrollPos, scrollPosTop);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user