Files: 455af00799601cb57c6ea54edad5e85c516b799f / lib / sheet / display.js
541 bytesRaw
1 | const h = require('mutant/h') |
2 | |
3 | module.exports = function (handler) { |
4 | const { content, footer, classList, onMount, attributes } = handler(done) |
5 | |
6 | let fullAttributes = { className: 'Sheet', classList } |
7 | if (attributes !== undefined) { |
8 | fullAttributes = { ...attributes, ...fullAttributes } |
9 | } |
10 | const container = h('div', fullAttributes, [ |
11 | h('section', [content]), |
12 | h('footer', [footer]) |
13 | ]) |
14 | |
15 | document.body.appendChild(container) |
16 | |
17 | if (onMount) onMount() |
18 | |
19 | function done () { |
20 | document.body.removeChild(container) |
21 | } |
22 | } |
23 |
Built with git-ssb-web