Files: 038e248915e3e8c69af62015ec1eb52f957d79f3 / app / html / menu.js
561 bytesRaw
1 | const nest = require('depnest') |
2 | const { h, Value } = require('mutant') |
3 | |
4 | exports.gives = nest('app.html.menu') |
5 | |
6 | exports.needs = nest('app.html.menuItem', 'map') |
7 | |
8 | exports.create = function (api) { |
9 | var _menu |
10 | |
11 | return nest('app.html.menu', function menu (handleClick) { |
12 | if (_menu) return _menu |
13 | |
14 | var state = Value('') |
15 | |
16 | _menu = h('Menu', { |
17 | classList: [ state ], |
18 | 'ev-mouseover': () => state.set('-active'), |
19 | 'ev-mouseout': () => state.set('') |
20 | }, [ |
21 | h('div', api.app.html.menuItem(handleClick)) |
22 | ]) |
23 | |
24 | return _menu |
25 | }) |
26 | } |
27 | |
28 |
Built with git-ssb-web