22 lines
428 B
JavaScript
22 lines
428 B
JavaScript
|
const m = require('mithril')
|
||
|
const Status = require('./page_status')
|
||
|
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)
|
||
|
}
|
||
|
|
||
|
m.route.prefix = ''
|
||
|
|
||
|
m.route(document.getElementById('main'), '/', {
|
||
|
'/': Status,
|
||
|
})
|