Skip to content

Instantly share code, notes, and snippets.

@robdodson
Created February 25, 2015 04:14
Show Gist options
  • Save robdodson/015965d474c1e6156fd8 to your computer and use it in GitHub Desktop.
Save robdodson/015965d474c1e6156fd8 to your computer and use it in GitHub Desktop.
reset scroll position
document.addEventListener('template-bound', function() {
var headerPanel = document.querySelector('[main]');
var pages = document.querySelector('core-pages');
pages.addEventListener('core-select', function(e) {
// Only handle the event once
if (e.detail && e.detail.isSelected) {
headerPanel.scroller.scrollTop = 0;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment