Files: ae5dc8ad4e093e668b8fcff19e4434330f5d9d24 / modules / app.js
460 bytesRaw
1 | var plugs = require('../plugs') |
2 | var h = require('hyperscript') |
3 | |
4 | var screen_view = plugs.first(exports.screen_view = []) |
5 | |
6 | exports.app = function () { |
7 | function hash() { |
8 | return window.location.hash.substring(1) |
9 | } |
10 | |
11 | var view = screen_view(hash() || 'tabs') |
12 | |
13 | var screen = h('div.screen.column', view) |
14 | |
15 | window.onhashchange = function (ev) { |
16 | var _view = view |
17 | screen.replaceChild(view = screen_view(hash()), _view) |
18 | } |
19 | |
20 | return screen |
21 | |
22 | } |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 |
Built with git-ssb-web