always scroll to top on page change

master
Jonatan Nilsson 2019-10-02 17:55:00 +00:00
parent 97c64003a7
commit 48e6d56ec1
2 changed files with 12 additions and 2 deletions

View File

@ -83,9 +83,7 @@ const Frontpage = {
},
view: function(vnode) {
console.log(this.articles)
var deviceWidth = window.innerWidth
var bannerPath = ''
if (this.featured && this.featured.banner) {

View File

@ -1,6 +1,18 @@
const m = require('mithril')
window.m = m
m.route.setOrig = m.route.set
m.route.set = function(path, data, options){
m.route.setOrig(path, data, options)
window.scrollTo(0, 0)
}
m.route.linkOrig = m.route.link
m.route.link = function(vnode){
m.route.linkOrig(vnode)
window.scrollTo(0, 0)
}
const Authentication = require('./authentication')
m.route.prefix = ''