Commit c4488f18986b2f896e7c2655b025def9a2f8c7a2
app/html/scroller - only add prepend/ append if present
mixmix committed on 9/26/2018, 10:26:13 PMParent: ee289a19dca6fefc3c9308225b6c429fdeb79ad6
Files changed
app/html/scroller.js | changed |
app/html/scroller.js | |||
---|---|---|---|
@@ -6,18 +6,18 @@ | |||
6 | 6 … | exports.create = function (api) { | |
7 | 7 … | return nest('app.html.scroller', Scroller) | |
8 | 8 … | ||
9 | 9 … | function Scroller (opts = {}) { | |
10 | - const { prepend = [], content = null, append = [], classList = [], className = '', title = '' } = opts | ||
10 … | + const { prepend, content = null, append, classList = [], className = '', title = '' } = opts | ||
11 | 11 … | ||
12 | 12 … | const contentSection = h('section.content', { title: '' }, content) | |
13 | 13 … | ||
14 | 14 … | const container = h('Scroller', | |
15 | 15 … | { classList, className, title, style: { 'overflow-y': 'scroll', 'overflow-x': 'auto' } }, | |
16 | 16 … | [ | |
17 | - h('section.top', prepend), | ||
17 … | + prepend ? h('section.top', prepend) : null, | ||
18 | 18 … | contentSection, | |
19 | - h('section.bottom', append) | ||
19 … | + append ? h('section.bottom', append) : null | ||
20 | 20 … | ] | |
21 | 21 … | ) | |
22 | 22 … | ||
23 | 23 … | container.scroll = keyscroll(contentSection) |
Built with git-ssb-web