Files: e7106661871a2d26bccc7ced98ca979b420058e8 / modules_core / 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.menu.column', {style: 'display: none;'}) |
8 | |
9 | var menu = h('div.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