git ssb

10+

Matt McKegg / patchwork



Commit 3c980b78e2e8d16fcd4b7216a0a9cdb94115b708

Use checkbox for filter settings

Michael LeGore committed on 9/19/2017, 2:17:21 AM
Parent: 7b05904de35826ff191a15f884a7b89328afa6b9

Files changed

modules/page/html/render/settings.jschanged
modules/page/html/render/settings.jsView
@@ -37,9 +37,9 @@
3737 ? { 'margin-right': '1rem', 'border-color': 'teal' }
3838 : { 'margin-right': '1rem' }
3939
4040 return h('button', {
41- 'ev-click': () => api.settings.sync.set({
41+ 'ev-click': () => api.settings.sync.set({
4242 patchwork: {theme: name}
4343 }),
4444 style
4545 }, name)
@@ -47,22 +47,17 @@
4747 })
4848 ]),
4949 h('section', [
5050 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+ ])
6560 ])
6661 ])
6762 ])
6863 ])

Built with git-ssb-web