Last active
July 9, 2016 21:15
-
-
Save TylerJPresley/15a8a70ca05a000bce8ab05b5b1d3fde to your computer and use it in GitHub Desktop.
Scroll to top post render // Aurelia (CLI/RequireJS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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