Files: 38af2fdb5719a156793f1114d29328b6f0386cd7 / modules / menu.js
665 bytesRaw
1 | var plugs = require('../plugs') |
2 | var h = require('hyperscript') |
3 | |
4 | var menu_items = plugs.map(exports.menu_items = []) |
5 | |
6 | var status = h('div.status.error') //start off disconnected |
7 | var list = h('div.column', {style: 'display: none;'}) |
8 | |
9 | var menu = h('div.menu.column', status, list , { |
10 | onmouseover: function (e) { |
11 | list.style.display = 'flex' |
12 | }, onmouseout: function () { |
13 | list.style.display = 'none' |
14 | } |
15 | }) |
16 | |
17 | exports.connection_status = function (err) { |
18 | if(err) status.classList.add('error') |
19 | else status.classList.remove('error') |
20 | } |
21 | |
22 | exports.menu = function () { |
23 | menu_items().forEach(function (el) { |
24 | list.appendChild(el) |
25 | }) |
26 | |
27 | return menu |
28 | } |
29 | |
30 | |
31 | |
32 |
Built with git-ssb-web