church_streamer/app/index.js

27 lines
644 B
JavaScript

const m = require('mithril')
const Header = require('./header')
const Status = require('./page_status')
const Display = require('./page_display')
const Encoder = require('./page_encoder')
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.mount(document.getElementById('header'), Header)
m.route(document.getElementById('main'), '/', {
'/': Status,
'/encoder': Encoder,
'/display': Display,
})