Commit c719e8965e88d58c418ef643791899d3e4df2ed3
default to tabs view
Dominic Tarr committed on 7/30/2016, 4:10:02 AMParent: 1a4ccb4dc20d081f7f29e659e14b850e48e14a96
Files changed
modules/app.js | changed |
modules/app.js | ||
---|---|---|
@@ -2,9 +2,9 @@ | ||
2 | 2 | var h = require('hyperscript') |
3 | 3 | |
4 | 4 | var screen_view = plugs.first(exports.screen_view = []) |
5 | 5 | |
6 | -var status = h('div.status') | |
6 | +var status = h('div.status.error') //start off disconnected | |
7 | 7 | |
8 | 8 | exports.connection_status = function (err) { |
9 | 9 | if(err) status.classList.add('error') |
10 | 10 | else status.classList.remove('error') |
@@ -20,9 +20,12 @@ | ||
20 | 20 | var screen = h('div.screen.column', status, view) |
21 | 21 | |
22 | 22 | window.onhashchange = function (ev) { |
23 | 23 | var _view = view |
24 | - screen.replaceChild(view = screen_view(hash()), _view) | |
24 | + view = screen_view(hash() || 'tabs') | |
25 | + | |
26 | + if(_view) screen.replaceChild(view, _view) | |
27 | + else document.body.appendChild(view) | |
25 | 28 | } |
26 | 29 | |
27 | 30 | return screen |
28 | 31 | |
@@ -44,4 +47,6 @@ | ||
44 | 47 | |
45 | 48 | |
46 | 49 | |
47 | 50 | |
51 | + | |
52 | + |
Built with git-ssb-web