client/general: scroll to top on page change
This commit is contained in:
parent
906eddc61f
commit
f083e5fdc8
1 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,12 @@
|
|||
require('./util/polyfill.js');
|
||||
|
||||
const page = require('page');
|
||||
const origPushState = page.Context.prototype.pushState;
|
||||
page.Context.prototype.pushState = function() {
|
||||
window.scrollTo(0, 0);
|
||||
origPushState.call(this);
|
||||
};
|
||||
|
||||
const mousetrap = require('mousetrap');
|
||||
page(/.*/, (ctx, next) => {
|
||||
mousetrap.reset();
|
||||
|
|
Loading…
Reference in a new issue