git ssb

0+

ev / microbay



forked from Dominic / patchbay

Tree: f37ef7f30e013104c6e999fbd9ada54421e74c5e

Files: f37ef7f30e013104c6e999fbd9ada54421e74c5e / 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