Commit 3c980b78e2e8d16fcd4b7216a0a9cdb94115b708
Use checkbox for filter settings
Michael LeGore committed on 9/19/2017, 2:17:21 AMParent: 7b05904de35826ff191a15f884a7b89328afa6b9
Files changed
modules/page/html/render/settings.js | changed |
modules/page/html/render/settings.js | ||
---|---|---|
@@ -37,9 +37,9 @@ | ||
37 | 37 | ? { 'margin-right': '1rem', 'border-color': 'teal' } |
38 | 38 | : { 'margin-right': '1rem' } |
39 | 39 | |
40 | 40 | return h('button', { |
41 | - 'ev-click': () => api.settings.sync.set({ | |
41 | + 'ev-click': () => api.settings.sync.set({ | |
42 | 42 | patchwork: {theme: name} |
43 | 43 | }), |
44 | 44 | style |
45 | 45 | }, name) |
@@ -47,22 +47,17 @@ | ||
47 | 47 | }) |
48 | 48 | ]), |
49 | 49 | h('section', [ |
50 | 50 | h('h2', 'Filters'), |
51 | - computed(filterFollowing, filter => { | |
52 | - const style = filter | |
53 | - ? { 'margin-right': '1rem', 'border-color': 'teal' } | |
54 | - : { 'margin-right': '1rem' } | |
55 | - | |
56 | - return [ | |
57 | - h('button', { | |
58 | - 'ev-click': () => api.settings.sync.set({ | |
59 | - filters: {following: !filter} | |
60 | - }), | |
61 | - style | |
62 | - }, filter ? 'Hide following messages' : 'Show following messages') | |
63 | - ] | |
64 | - }) | |
51 | + h('label', [ | |
52 | + h('input', { | |
53 | + type: 'checkbox', | |
54 | + checked: filterFollowing, | |
55 | + 'ev-change': (ev) => api.settings.sync.set({ | |
56 | + filters: {following: ev.target.checked} | |
57 | + }) | |
58 | + }), ' Hide following messages' | |
59 | + ]) | |
65 | 60 | ]) |
66 | 61 | ]) |
67 | 62 | ]) |
68 | 63 | ]) |
Built with git-ssb-web