Commit ff9a800eba7a7ee2f4a807f80c33afa4fa798fa2
implement < Discovery as a back button
mix irving committed on 12/3/2017, 2:46:14 AMParent: 930a234f8e8c982d1f957647399cb38c7eae3dba
Files changed
app/html/blogNav.js | changed |
app/html/blogNav.js | ||
---|---|---|
@@ -5,15 +5,17 @@ | ||
5 | 5 | exports.gives = nest('app.html.blogNav') |
6 | 6 | |
7 | 7 | exports.needs = nest({ |
8 | 8 | 'history.sync.push': 'first', |
9 | + 'history.sync.back': 'first', | |
9 | 10 | 'translations.sync.strings': 'first', |
10 | 11 | }) |
11 | 12 | |
12 | 13 | exports.create = (api) => { |
13 | 14 | return nest('app.html.blogNav', (location) => { |
14 | 15 | const strings = api.translations.sync.strings() |
15 | 16 | const goTo = (loc) => () => api.history.sync.push(loc) |
17 | + const back = () => api.history.sync.back() | |
16 | 18 | |
17 | 19 | if (location.page === 'blogIndex' || location.page === 'blogSearch') { |
18 | 20 | return h('BlogNav', [ |
19 | 21 | h('div.left', [ |
@@ -33,9 +35,9 @@ | ||
33 | 35 | } |
34 | 36 | |
35 | 37 | return h('BlogNav', [ |
36 | 38 | h('div.left', [ |
37 | - h('div.-discovery', { 'ev-click': goTo({ page: 'blogIndex' }) }, [ | |
39 | + h('div.-discovery', { 'ev-click': back }, [ | |
38 | 40 | h('i.fa.fa-chevron-left'), |
39 | 41 | strings.blogIndex.title |
40 | 42 | ]), |
41 | 43 | ]), |
Built with git-ssb-web