From bd99f360f6ffdfbad97b223754d5483c8d14787b Mon Sep 17 00:00:00 2001 From: Ev Bogue Date: Sat, 6 Apr 2019 16:04:16 -0500 Subject: I think this will render threads correctly --- lib.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib.js b/lib.js index c386e5a..8b9c5a8 100644 --- a/lib.js +++ b/lib.js @@ -108,6 +108,7 @@ function readFile () { // render messages function renderMessage (post) { + var messageDiv = h('messageDiv') var message = h('div', {classList: 'message'}) if (post.content.type == 'name') { @@ -141,7 +142,7 @@ function renderMessage (post) { var nextPost = log[i] console.log(nextPost) - scroller.appendChild(h('div', {classList: 'submessage'}, [ + messageDiv.appendChild(h('div', {classList: 'submessage'}, [ renderMessage(nextPost) ])) @@ -207,9 +208,10 @@ function renderMessage (post) { }, ['Reply']) message.appendChild(replyButton) + messageDiv.appendChild(message) } - return message + return messageDiv } -- cgit v1.2.3-70-g09d2