Skip to content

Commit

Permalink
Keep scroll position in flatprofile view on repaint - closes NoiseByN…
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRuf authored Sep 22, 2024
1 parent b9dd4c2 commit 64aecef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/web-ui/js/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,13 @@ class Widget {

this.repaintTimeout = setTimeout(
() => {
let initialScrollPos = 0;
this.repaintTimeout = null;

const id = this.container.attr('id');
if (id === 'flatprofile') {
initialScrollPos = document.querySelector('#flatprofile > div').scrollTop;
}
console.time('repaint ' + id);
console.time('clear ' + id);
this.clear();
Expand All @@ -583,6 +587,9 @@ class Widget {
this.render();
console.timeEnd('render ' + id);
console.timeEnd('repaint ' + id);
if (id === 'flatprofile') {
document.querySelector('#flatprofile > div').scrollTop = initialScrollPos;
}
},
0
);
Expand Down

0 comments on commit 64aecef

Please sign in to comment.