Persistence of search toggles

This commit is contained in:
Claude Brisson
2024-01-20 11:17:38 +01:00
parent c277b5981d
commit 5890ba6f41
2 changed files with 10 additions and 6 deletions

View File

@@ -255,17 +255,13 @@ onLoad(() => {
// persistent scroll
$('#center').on('scroll', e => {
let scroll = $('#center')[0].scrollTop;
console.log(`scroll=${scroll}`);
store('scroll', scroll);
});
let persistentScroll = store('scroll');
if (persistentScroll) {
setTimeout(() => {
console.log(`scrollHeight = ${$('#center')[0].scrollHeight}`);
console.log(`scrolling to ${persistentScroll}`);
$('#center')[0].scrollTop = persistentScroll;
let scroll = $('#center')[0].scrollTop;
console.log(`scrolled to ${scroll}`);
}, 200);
}