Maintain scroll positions when switching tabs

This commit is contained in:
Ken-Håvard Lieng 2017-05-03 22:56:06 +02:00
parent 45c61e7596
commit 52acec9d21
4 changed files with 81 additions and 29 deletions

View file

@ -0,0 +1,12 @@
const positions = {};
export function getScrollPos(key) {
if (key in positions) {
return positions[key];
}
return -1;
}
export function saveScrollPos(key, pos) {
positions[key] = pos;
}