firefox scroll persistence fix

This commit is contained in:
Heydon Pickering 2017-07-21 08:53:42 +01:00
parent 667a4d4f03
commit e85f817bac
3 changed files with 7 additions and 7 deletions

View File

@ -29,12 +29,12 @@
/* persist navigation scroll point */
(function () {
window.addEventListener('unload', function() {
window.onunload = function () {
var scrollPoint = document.getElementById('patterns-nav').scrollTop
localStorage.setItem('scrollPoint', scrollPoint)
})
}
window.addEventListener('load', function() {
window.addEventListener('DOMContentLoaded', function () {
document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint'))
})
}());

File diff suppressed because one or more lines are too long

View File

@ -29,12 +29,12 @@
/* persist navigation scroll point */
(function () {
window.addEventListener('unload', function() {
window.onunload = function () {
var scrollPoint = document.getElementById('patterns-nav').scrollTop
localStorage.setItem('scrollPoint', scrollPoint)
})
}
window.addEventListener('load', function() {
window.addEventListener('DOMContentLoaded', function () {
document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint'))
})
}());