reset nav scrollTop if not on pattern page

This commit is contained in:
Heydon Pickering 2017-07-23 11:31:23 +01:00
parent 36bf525ad7
commit 4c207a345f
3 changed files with 11 additions and 3 deletions

View File

@ -35,6 +35,10 @@
}
window.addEventListener('DOMContentLoaded', function () {
document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint'))
if (window.location.href.indexOf('patterns/') !== -1) {
document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint'))
} else {
document.getElementById('patterns-nav').scrollTop = 0
}
})
}());

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,10 @@
}
window.addEventListener('DOMContentLoaded', function () {
document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint'))
if (window.location.href.indexOf('patterns/') !== -1) {
document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint'))
} else {
document.getElementById('patterns-nav').scrollTop = 0
}
})
}());