git ssb

16+

Dominic / patchbay



Tree: 2c6e20555336c47eae846c5db7b268cf2a85c159

Files: 2c6e20555336c47eae846c5db7b268cf2a85c159 / modules_core / menu.js

911 bytesRaw
1var plugs = require('../plugs')
2var h = require('hyperscript')
3
4module.exports = {
5 needs: {menu_items: 'map'},
6 gives: {connection_status: true, menu: true},
7 create: function (api) {
8
9 var menu_items = api.menu_items //plugs.map(exports.menu_items = [])
10
11 var status = h('div.status.error') //start off disconnected
12 var list = h('div.menu.column', {style: 'display: none;'})
13
14 var menu = h('div.column', status, list , {
15 onmouseover: function (e) {
16 list.style.display = 'flex'
17 }, onmouseout: function () {
18 list.style.display = 'none'
19 }
20 })
21
22 return {
23 connection_status: function (err) {
24 if(err) status.classList.add('error')
25 else status.classList.remove('error')
26 },
27 menu: function () {
28 menu_items().forEach(function (el) {
29 if(el)
30 list.appendChild(el)
31 })
32 }
33 }
34 }
35}
36
37
38
39
40

Built with git-ssb-web