Commit 1239690dc41098bef2ddfd0f321e54dc0ab27fd7
sneak blog filter in above scroller content with insertBefore
mix irving committed on 6/2/2018, 12:33:07 PMParent: 0d85d682b95d0df9f77c9c798d1070cca80470e3
Files changed
app/html/scroller.js | changed |
app/html/scroller.mcss | changed |
app/page/blogIndex.js | changed |
app/page/blogIndex.mcss | changed |
package-lock.json | changed |
package.json | changed |
app/html/scroller.js | ||
---|---|---|
@@ -28,9 +28,15 @@ | ||
28 | 28 | next(stream, { live: false, reverse: true, limit: 100, property: indexProperty }), |
29 | 29 | filter() |
30 | 30 | ) |
31 | 31 | |
32 | - return Scroller(Object.assign({}, opts, { streamToTop, streamToBottom })) | |
32 | + const _opts = Object.assign( | |
33 | + { overflowY: 'auto' }, // TODO check across app what makes better default | |
34 | + opts, | |
35 | + { streamToTop, streamToBottom } | |
36 | + ) | |
37 | + | |
38 | + return Scroller(_opts) | |
33 | 39 | // valid Scroller opts : see github.com/mixmix/mutant-scroll |
34 | 40 | // classList = [], |
35 | 41 | // prepend = [], |
36 | 42 | // append = [], |
@@ -40,6 +46,7 @@ | ||
40 | 46 | // updateTop = updateTopDefault, |
41 | 47 | // updateBottom = updateBottomDefault, |
42 | 48 | // store = MutantArray(), |
43 | 49 | // cb = (err) => { if (err) throw err } |
50 | + // overflowY = 'scroll' | |
44 | 51 | } |
45 | 52 | } |
app/html/scroller.mcss | ||
---|---|---|
@@ -1,6 +1,6 @@ | ||
1 | 1 | Scroller { |
2 | - overflow: auto | |
2 | + overflow-y: scroll | |
3 | 3 | width: 100% |
4 | 4 | /* height: 100% */ |
5 | 5 | min-height: 0px |
6 | 6 |
app/page/blogIndex.js | ||
---|---|---|
@@ -38,9 +38,9 @@ | ||
38 | 38 | var blogs = Scroller({ |
39 | 39 | classList: ['content'], |
40 | 40 | prepend: [ |
41 | 41 | api.app.html.topNav(location), |
42 | - Filters() | |
42 | + // Filters() | |
43 | 43 | ], |
44 | 44 | streamToTop: Source({ reverse: false, live: true, old: false, limit: 20 }, api, filter), |
45 | 45 | streamToBottom: Source({ reverse: true, live: false, limit: 20 }, api, filter), |
46 | 46 | updateTop: update, |
@@ -48,8 +48,11 @@ | ||
48 | 48 | store: blogsCache, |
49 | 49 | render |
50 | 50 | }) |
51 | 51 | |
52 | + // HACK | |
53 | + blogs.insertBefore(Filters(), blogs.querySelector('.content')) | |
54 | + | |
52 | 55 | function Filters () { |
53 | 56 | const goTo = (loc) => () => api.history.sync.push(loc) |
54 | 57 | return h('Filters', [ |
55 | 58 | h('span -filter', { |
app/page/blogIndex.mcss | ||
---|---|---|
@@ -25,16 +25,16 @@ | ||
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | 28 | Filters { |
29 | - background-color: #f1f1f1 | |
29 | + $maxWidth | |
30 | + padding: 0 2rem | |
31 | + margin: .8rem auto | |
30 | 32 | |
31 | 33 | font-size: .8rem |
32 | 34 | text-transform: uppercase |
33 | 35 | letter-spacing: 1.4px |
34 | 36 | |
35 | - padding: .5rem 0 .5rem .5rem | |
36 | - | |
37 | 37 | display: grid |
38 | 38 | grid-template-columns: 4rem 0rem 10rem 0rem 7rem |
39 | 39 | justify-items: center |
40 | 40 |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 284705 bytes New file size: 282870 bytes |
package.json | ||
---|---|---|
@@ -40,9 +40,9 @@ | ||
40 | 40 | "medium-editor-markdown": "^2.6.0", |
41 | 41 | "micro-css": "^2.0.1", |
42 | 42 | "morphdom": "^2.3.3", |
43 | 43 | "mutant": "^3.22.1", |
44 | - "mutant-scroll": "0.0.5", | |
44 | + "mutant-scroll": "0.0.6", | |
45 | 45 | "open-external": "^0.1.1", |
46 | 46 | "patch-drafts": "0.0.6", |
47 | 47 | "patch-history": "^1.0.0", |
48 | 48 | "patch-profile": "^1.0.4", |
Built with git-ssb-web