Skip to content

Instantly share code, notes, and snippets.

@TylerJPresley
Last active July 9, 2016 21:15
Show Gist options
  • Save TylerJPresley/15a8a70ca05a000bce8ab05b5b1d3fde to your computer and use it in GitHub Desktop.
Save TylerJPresley/15a8a70ca05a000bce8ab05b5b1d3fde to your computer and use it in GitHub Desktop.
Scroll to top post render // Aurelia (CLI/RequireJS)
/**
* Imports
*/
import {PagePostRender} from 'page-post-render';
/**
* App Class
* @class
*/
export class App {
/**
* Configures the router
*/
configureRouter(config, router) {
/** Add in a pipeline step for postrender */
config.addPipelineStep('postRender', PagePostRender);
}
}
/**
* PagePostRender Class
* @class
*/
export class PagePostRender {
/**
* Pipeline step
*/
run(instruction, next) {
/** Scroll to top */
window.scrollTo(0, 0);
/** Go to next step */
return next();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment