Template finishing touches

This commit is contained in:
Angelos Chalaris
2019-08-30 19:52:04 +03:00
parent f3f77d5708
commit 37bab8ea6d
4 changed files with 54 additions and 25 deletions

View File

@ -5,4 +5,25 @@
*/
// You can delete this file if you're not using it
let locationScrollTops = [];
const onPreRouteUpdate = ({ location, prevLocation }) => {
try {
let scrollTop = document.querySelector('.content').scrollTop;
locationScrollTops[prevLocation.pathname] = scrollTop;
}
catch (e) { }
};
const onRouteUpdate = ({ location, prevLocation }) => {
try {
if (locationScrollTops[location.pathname]) {
document.querySelector('.content').scrollTop = locationScrollTops[location.pathname];
}
}
catch (e) { }
}
export { default as wrapRootElement } from './src/docs/state/ReduxWrapper';
export { onPreRouteUpdate, onRouteUpdate };