Commit 09b5f547eae3101aadd573367a0f734ce0caf87c
working nested comments in notifications
mix irving committed on 5/7/2018, 5:23:01 AMParent: 87dd7388171016a3b49fb155c4b07fd06b4c5436
Files changed
app/page/notifications.mcss | changed |
message/html/comment.js | changed |
message/html/comment.mcss | changed |
app/page/notifications.mcss | ||
---|---|---|
@@ -1,11 +1,21 @@ | ||
1 | 1 | Page -notifications { |
2 | 2 | div.Scroller.content { |
3 | 3 | |
4 | 4 | section.content { |
5 | + padding-top: 2rem | |
6 | + | |
5 | 7 | div.Comment { |
6 | 8 | flex-grow: 1 |
7 | 9 | |
10 | + div.right { | |
11 | + section.replies { | |
12 | + | |
13 | + div.Comment.-nested { | |
14 | + $backgroundPrimary | |
15 | + } | |
16 | + } | |
17 | + } | |
8 | 18 | } |
9 | 19 | } |
10 | 20 | } |
11 | 21 | } |
message/html/comment.js | ||
---|---|---|
@@ -33,10 +33,10 @@ | ||
33 | 33 | |
34 | 34 | if (!replies) { |
35 | 35 | replies = computed(api.backlinks.obs.for(msg.key), backlinks => { |
36 | 36 | return backlinks.filter(backlinker => { |
37 | - const { type, root } = backlinker.value.content | |
38 | - return type === 'post' && root === msg.key | |
37 | + const { type, root: _root, fork } = backlinker.value.content | |
38 | + return type === 'post' && fork === msg.key && _root === root | |
39 | 39 | }) |
40 | 40 | }) |
41 | 41 | } |
42 | 42 | if (!branch) { |
@@ -81,8 +81,14 @@ | ||
81 | 81 | when(showRootLink, h('a.rootLink', {href: root}, ['<< ', title, ' >>'])) |
82 | 82 | // TODO don't link to root, link to position of message within blog! |
83 | 83 | ]), |
84 | 84 | h('section.content', api.message.html.markdown(get(msg, 'value.content.text'))), |
85 | + h('section.actions', [ | |
86 | + h('div.reply', { 'ev-click': toggleCompose }, [ | |
87 | + h('i.fa.fa-commenting-o') | |
88 | + ]), | |
89 | + api.message.html.likes(msg) | |
90 | + ]), | |
85 | 91 | when(replies, |
86 | 92 | h('section.replies', |
87 | 93 | map( |
88 | 94 | replies, |
@@ -95,14 +101,8 @@ | ||
95 | 101 | } |
96 | 102 | ) |
97 | 103 | ) |
98 | 104 | ), |
99 | - h('section.actions', [ | |
100 | - h('div.reply', { 'ev-click': toggleCompose }, [ | |
101 | - h('i.fa.fa-commenting-o') | |
102 | - ]), | |
103 | - api.message.html.likes(msg) | |
104 | - ]), | |
105 | 105 | when(nestedReplyCompose, nestedReplyComposer) |
106 | 106 | ]) |
107 | 107 | ]) |
108 | 108 | } |
Built with git-ssb-web