git ssb

16+

Dominic / patchbay



Tree: 5f6e9b441698b112f61c602d52d80a419f953a73

Files: 5f6e9b441698b112f61c602d52d80a419f953a73 / modules / app.js

560 bytesRaw
1var plugs = require('../plugs')
2var h = require('hyperscript')
3
4var screen_view = plugs.first(exports.screen_view = [])
5
6
7exports.app = function () {
8 function hash() {
9 return window.location.hash.substring(1)
10 }
11
12 var view = screen_view(hash() || 'tabs')
13
14 var screen = h('div.screen.column', view)
15
16 window.onhashchange = function (ev) {
17 var _view = view
18 view = screen_view(hash() || 'tabs')
19
20 if(_view) screen.replaceChild(view, _view)
21 else document.body.appendChild(view)
22 }
23
24
25 return screen
26
27}
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

Built with git-ssb-web