git ssb

16+

Dominic / patchbay



Tree: 226d1bbd231cc9cded2c2299eaf7b5c5dcfd6f64

Files: 226d1bbd231cc9cded2c2299eaf7b5c5dcfd6f64 / app / html / menu.js

644 bytesRaw
1const nest = require('depnest')
2const { h, Value } = require('mutant')
3
4exports.gives = nest('app.html.menu')
5
6exports.needs = nest({
7 app: {
8 'html.menuItem': 'map',
9 'sync.goTo': 'first'
10 }
11})
12
13exports.create = function (api) {
14 var _menu
15
16 return nest('app.html.menu', function menu () {
17 if (_menu) return _menu
18
19 var state = Value('')
20
21 // TODO: move goTo out into each menuItem
22 _menu = h('Menu', {
23 classList: [ state ],
24 'ev-mouseover': () => state.set('-active'),
25 'ev-mouseout': () => state.set('')
26 }, [
27 h('div', api.app.html.menuItem(api.app.sync.goTo))
28 ])
29
30 return _menu
31 })
32}
33

Built with git-ssb-web